1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Add --force to pvchange, and allow override of prompt involving metadataignore.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
Dave Wysochanski 2010-07-07 19:14:57 +00:00
parent 90b96af68f
commit 96c3c4645f
6 changed files with 9 additions and 3 deletions

View File

@ -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]

View File

@ -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 ]

View File

@ -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

View File

@ -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"

View File

@ -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]: ",

View File

@ -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]: ",