]> sourceware.org Git - lvm2.git/commitdiff
Add --force to pvchange, and allow override of prompt involving metadataignore.
authorDave Wysochanski <dwysocha@redhat.com>
Wed, 7 Jul 2010 19:14:57 +0000 (19:14 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Wed, 7 Jul 2010 19:14:57 +0000 (19:14 +0000)
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
man/pvchange.8.in
man/vgextend.8.in
test/t-metadata-balance.sh
tools/commands.h
tools/pvchange.c
tools/vgextend.c

index 19204bedcf3d252a16637dbe40076e6075f95ae2..22080727bdbc56ebff11d542de007fc264ffeaea 100644 (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]
index 244517db4e53405f8e71e6b322be85b2b0d855bf..fffb17672757a10de116ca8806c75a8ec8fc4fb9 100644 (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 ]
index 7bd7d43e4e47feccd673de18400fbf7561bcfe9f..79570d9b3e603707b1343f3932c22e39aba5571d 100755 (executable)
@@ -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
index 2b349333b869df61e9d71d4d1a37a9208137ad7f..d9e13f42443c1d5cbe68c3ae96c44b04f3fd8673 100644 (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"
index c1c6a4cb78a3842201c1011e8e3d70eb9945b8e8..0c267999ef1c05ee77a8032e3720e2b30823929a 100644 (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]: ",
index fc55d407ea16172b9e14a5fffc3b83ab2f9fbb03..5cd4bb4b5a7a9404f34cc0b06414de496bdaab3e 100644 (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]: ",
This page took 0.041998 seconds and 5 git commands to generate.