diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2010-07-07 19:14:57 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2010-07-07 19:14:57 +0000 |
commit | 96c3c4645fea77e411acc380aa93efd99d45a796 (patch) | |
tree | 8612a9aeccab7f85f52a1d57d96afb6ae0283f67 | |
parent | 90b96af68fbe714ce5bb7b0eb0f383faecb1e6b5 (diff) | |
download | lvm2-96c3c4645fea77e411acc380aa93efd99d45a796.tar.gz lvm2-96c3c4645fea77e411acc380aa93efd99d45a796.tar.xz lvm2-96c3c4645fea77e411acc380aa93efd99d45a796.zip |
Add --force to pvchange, and allow override of prompt involving metadataignore.
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
-rw-r--r-- | man/pvchange.8.in | 1 | ||||
-rw-r--r-- | man/vgextend.8.in | 1 | ||||
-rwxr-xr-x | test/t-metadata-balance.sh | 4 | ||||
-rw-r--r-- | tools/commands.h | 4 | ||||
-rw-r--r-- | tools/pvchange.c | 1 | ||||
-rw-r--r-- | tools/vgextend.c | 1 |
6 files changed, 9 insertions, 3 deletions
diff --git a/man/pvchange.8.in b/man/pvchange.8.in index 19204bed..22080727 100644 --- a/man/pvchange.8.in +++ b/man/pvchange.8.in @@ -5,6 +5,7 @@ pvchange \- change attributes of a physical volume .B pvchange [\-\-addtag Tag] [\-A|\-\-autobackup y|n] [\-d|\-\-debug] +[\-f|\-\-force] [\-\-deltag Tag] [\-\-metadataignore y|n] [\-h|\-?|\-\-help] diff --git a/man/vgextend.8.in b/man/vgextend.8.in index 244517db..fffb1767 100644 --- a/man/vgextend.8.in +++ b/man/vgextend.8.in @@ -4,6 +4,7 @@ vgextend \- add physical volumes to a volume group .SH SYNOPSIS .B vgextend [\-A|\-\-autobackup y|n] [\-d|\-\-debug] [\-h|\-?|\-\-help] +[\-f|\-\-force] [\-t|\-\-test] [\-v|\-\-verbose] [ \fIPHYSICAL DEVICE OPTIONS\fP ] diff --git a/test/t-metadata-balance.sh b/test/t-metadata-balance.sh index 7bd7d43e..79570d9b 100755 --- a/test/t-metadata-balance.sh +++ b/test/t-metadata-balance.sh @@ -214,7 +214,7 @@ for mdacp in 1 2; do vgextend $vg1 $dev3 check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 1)) echo Using pvchange to unignore should update vg_mda_used_count - pvchange --metadataignore n $dev3 + pvchange -f --metadataignore n $dev3 check_pv_field_ $dev3 pv_mda_used_count $mdacp check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 2)) echo Set unmanaged on the vg should keep ignore bits the same during vgextend @@ -225,7 +225,7 @@ for mdacp in 1 2; do check_pv_field_ $dev4 pv_mda_used_count $mdacp check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 3)) echo Using pvchange to ignore should update vg_mda_used_count - pvchange --metadataignore y $dev4 + pvchange -f --metadataignore y $dev4 check_pv_field_ $dev4 pv_mda_used_count 0 check_vg_field_ $vg1 vg_mda_used_count $(($mdacp * 2)) vgremove -f $vg1 diff --git a/tools/commands.h b/tools/commands.h index 2b349333..d9e13f42 100644 --- a/tools/commands.h +++ b/tools/commands.h @@ -451,6 +451,7 @@ xx(pvchange, "\t[-a|--all]\n" "\t[-A|--autobackup y|n]\n" "\t[-d|--debug]\n" + "\t[-f|--force]\n" "\t[-h|--help]\n" "\t[-t|--test]\n" "\t[-u|--uuid]\n" @@ -463,7 +464,7 @@ xx(pvchange, "\t[PhysicalVolumePath...]\n", all_ARG, allocatable_ARG, allocation_ARG, autobackup_ARG, deltag_ARG, - addtag_ARG, metadataignore_ARG, test_ARG, uuid_ARG) + addtag_ARG, force_ARG, metadataignore_ARG, test_ARG, uuid_ARG) xx(pvresize, "Resize physical volume(s)", @@ -846,6 +847,7 @@ xx(vgextend, "vgextend\n" "\t[-A|--autobackup y|n]\n" "\t[-d|--debug]\n" + "\t[-f|--force]\n" "\t[-h|--help]\n" "\t[-t|--test]\n" "\t[-v|--verbose]\n" diff --git a/tools/pvchange.c b/tools/pvchange.c index c1c6a4cb..0c267999 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -123,6 +123,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct volume_group *vg, } } else if (arg_count(cmd, metadataignore_ARG)) { if ((vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && + (arg_count(cmd, force_ARG) == PROMPT) && yes_no_prompt("Setting metadataignore on %s will override " "preferred number of copies of VG %s " "metadata.\nAre you sure? [y/n]: ", diff --git a/tools/vgextend.c b/tools/vgextend.c index fc55d407..5cd4bb4b 100644 --- a/tools/vgextend.c +++ b/tools/vgextend.c @@ -61,6 +61,7 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv) if (arg_count(cmd, metadataignore_ARG) && (vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) && + (pp.force == PROMPT) && yes_no_prompt("Setting metadataignore will override " "preferred number of copies of VG %s " "metadata.\nAre you sure? [y/n]: ", |