dev-mornfall-lvmcache - clvmd: preserve foreground mode across restart
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0125518d6d0a0fce63998fc898c203255ad73700 Commit: 0125518d6d0a0fce63998fc898c203255ad73700 Parent: c9d8d22224f5516f364bd66ce41aa506a39801a6 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Apr 20 22:23:36 2013 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Sun Apr 21 22:56:48 2013 +0200
clvmd: preserve foreground mode across restart
Keep clvmd in foreground when restarted.
Useful for testing.
--- daemons/clvmd/clvmd-command.c | 8 ++++++-- daemons/clvmd/clvmd.c | 5 +++++ daemons/clvmd/clvmd.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-)
daemons/clvmd/clvmd-command.c +6 -2
@@ -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;
daemons/clvmd/clvmd.c +5 -0
@@ -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 ];
daemons/clvmd/clvmd.h +1 -0
@@ -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);