mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
clvmd: preserve foreground mode across restart
Keep clvmd in foreground when restarted. Useful for testing.
This commit is contained in:
parent
c9d8d22224
commit
0125518d6d
@ -383,7 +383,7 @@ static int restart_clvmd(void)
|
||||
} while (hn);
|
||||
|
||||
/* clvmd + locks (-E uuid) + debug (-d X) + NULL */
|
||||
if (!(argv = malloc((max_locks * 2 + 5) * sizeof(*argv))))
|
||||
if (!(argv = malloc((max_locks * 2 + 6) * sizeof(*argv))))
|
||||
goto_out;
|
||||
|
||||
/*
|
||||
@ -391,13 +391,17 @@ static int restart_clvmd(void)
|
||||
*/
|
||||
argv[argc++] = "clvmd";
|
||||
|
||||
/* Propogate debug options */
|
||||
/* Propagate debug options */
|
||||
if (clvmd_get_debug()) {
|
||||
if (dm_snprintf(debug_arg, sizeof(debug_arg), "-d%u", clvmd_get_debug()) < 0)
|
||||
goto_out;
|
||||
argv[argc++] = debug_arg;
|
||||
}
|
||||
|
||||
/* Propagate foreground options */
|
||||
if (clvmd_get_foreground())
|
||||
argv[argc++] = "-f";
|
||||
|
||||
argv[argc++] = "-I";
|
||||
argv[argc++] = clops->name;
|
||||
|
||||
|
@ -249,6 +249,11 @@ debug_t clvmd_get_debug(void)
|
||||
return debug;
|
||||
}
|
||||
|
||||
int clvmd_get_foreground(void)
|
||||
{
|
||||
return foreground_mode;
|
||||
}
|
||||
|
||||
static const char *decode_cmd(unsigned char cmdl)
|
||||
{
|
||||
static char buf[128];
|
||||
|
@ -119,6 +119,7 @@ extern void debuglog(const char *fmt, ... )
|
||||
|
||||
void clvmd_set_debug(debug_t new_de);
|
||||
debug_t clvmd_get_debug(void);
|
||||
int clvmd_get_foreground(void);
|
||||
|
||||
int sync_lock(const char *resource, int mode, int flags, int *lockid);
|
||||
int sync_unlock(const char *resource, int lockid);
|
||||
|
Loading…
Reference in New Issue
Block a user