[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 1/11] lvconvert takes '--wait' instead of '--background'



Remove '--background' option and add '--wait' option to lvconvert.

Recent change in lvconvert let it starts polling the conversion by default
for adding mirror(s).
'--background' is an option to immediately exit from the command and
do the polling in background.

The option was inherited from pvmove.
However, since lvconvert used to exit immediately and it still does
for different types of conversion (e.g. linear to mirror conversion),
it's more consistent and intuitive to add '--wait' option for foreground
polling and do it in background by default.

-- 
Jun'ichi Nomura, NEC Corporation of America
Remove '--background' option and add '--wait' option to lvconvert.

Recent change in lvconvert let it starts polling the conversion by default
for adding mirror(s).
'--background' is an option to immediately exit from the command and
do the polling in background.

The option was inherited from pvmove.
However, since lvconvert used to exit immediately and it still does
for different types of conversion (e.g. linear to mirror conversion),
it's more consistent and intuitive to add '--wait' option for foreground
polling and do it in background by default.

Index: LVM2.work/man/lvconvert.8
===================================================================
--- LVM2.work.orig/man/lvconvert.8
+++ LVM2.work/man/lvconvert.8
@@ -5,7 +5,7 @@ lvconvert \- convert a logical volume fr
 .B lvconvert
 \-m/\-\-mirrors Mirrors [\-\-mirrorlog {disk|core}] [\-\-corelog] [\-R/\-\-regionsize MirrorLogRegionSize]
 [\-A/\-\-alloc AllocationPolicy]
-[\-b/\-\-background] [\-i/\-\-interval Seconds]
+[\-\-wait] [\-i/\-\-interval Seconds]
 [\-h/\-?/\-\-help]
 [\-v/\-\-verbose]
 [\-\-version]
@@ -54,8 +54,8 @@ The optional argument "--corelog" is the
 A mirror is divided into regions of this size (in MB), and the mirror log
 uses this granularity to track which regions are in sync.
 .TP
-.I \-b, \-\-background
-Run the daemon in the background.
+.I \-\-wait
+Wait for the completion instead of running the daemon in the background.
 .TP
 .I \-i, \-\-interval Seconds
 Report progress as a percentage at regular intervals.
Index: LVM2.work/tools/args.h
===================================================================
--- LVM2.work.orig/tools/args.h
+++ LVM2.work/tools/args.h
@@ -53,6 +53,7 @@ arg(monitor_ARG, '\0', "monitor", yes_no
 arg(config_ARG, '\0', "config", string_arg, 0)
 arg(trustcache_ARG, '\0', "trustcache", NULL, 0)
 arg(ignoremonitoring_ARG, '\0', "ignoremonitoring", NULL, 0)
+arg(wait_ARG, '\0', "wait", NULL, 0)
 
 /* Allow some variations */
 arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0)
Index: LVM2.work/tools/commands.h
===================================================================
--- LVM2.work.orig/tools/commands.h
+++ LVM2.work/tools/commands.h
@@ -109,7 +109,7 @@ xx(lvconvert,
    "\t[--version]" "\n"
    "\tOriginalLogicalVolume[Path] SnapshotLogicalVolume[Path]\n",
 
-   alloc_ARG, background_ARG, chunksize_ARG, corelog_ARG, interval_ARG,
+   alloc_ARG, wait_ARG, chunksize_ARG, corelog_ARG, interval_ARG,
    mirrorlog_ARG, mirrors_ARG, regionsize_ARG, snapshot_ARG, test_ARG, zero_ARG)
 
 xx(lvcreate,
Index: LVM2.work/tools/lvconvert.c
===================================================================
--- LVM2.work.orig/tools/lvconvert.c
+++ LVM2.work/tools/lvconvert.c
@@ -746,7 +746,7 @@ error:
 			return ret;
 		}
 		ret = lvconvert_poll(cmd, lp.lv_name_full,
-				     arg_count(cmd, background_ARG) ? 1U : 0);
+				     arg_count(cmd, wait_ARG) ? 0 : 1U);
 	}
 
 	return ret;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]