summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2015-10-23 10:21:06 -0500
committerDavid Teigland <teigland@redhat.com>2015-10-23 10:21:06 -0500
commit98d81a43ea31ec963a36b8610f3b5a9be28b4cc1 (patch)
treece4e771b2852bf25957179fc2c70b904477ed1c7
parent1a74171ca5682a684d0e05c6090c3d33cab8795b (diff)
downloadlvm2-98d81a43ea31ec963a36b8610f3b5a9be28b4cc1.tar.gz
vgextend: fix use of the wrong flag
The ONE_VGNAME_ARG was being passed and tested as vg_read() flag but it's a cmd struct flag. (It affects command arg processing in toollib, not vg_read behavior. Flags related to command processing are generally cmd struct flags, while vg_read arg flags are generally related to vg_read behavior.)
-rw-r--r--tools/commands.h2
-rw-r--r--tools/toollib.c2
-rw-r--r--tools/vgextend.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/tools/commands.h b/tools/commands.h
index 92d13fdf0..ae5dff7fd 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -1211,7 +1211,7 @@ xx(vgexport,
xx(vgextend,
"Add physical volumes to a volume group",
- 0,
+ ONE_VGNAME_ARG,
"vgextend\n"
"\t[-A|--autobackup y|n]\n"
"\t[--restoremissing]\n"
diff --git a/tools/toollib.c b/tools/toollib.c
index b17fe5398..39bf0ac12 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2032,7 +2032,7 @@ int process_each_vg(struct cmd_context *cmd, int argc, char **argv,
struct dm_list vgnameids_to_process; /* vgnameid_list */
int enable_all_vgs = (cmd->command->flags & ALL_VGS_IS_DEFAULT);
- unsigned one_vgname_arg = (flags & ONE_VGNAME_ARG);
+ int one_vgname_arg = (cmd->command->flags & ONE_VGNAME_ARG);
int ret;
/* Disable error in vg_read so we can print it from ignore_vg. */
diff --git a/tools/vgextend.c b/tools/vgextend.c
index 581c21127..bddc22f92 100644
--- a/tools/vgextend.c
+++ b/tools/vgextend.c
@@ -170,7 +170,7 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
return_ECMD_FAILED;
ret = process_each_vg(cmd, argc, argv,
- READ_FOR_UPDATE | ONE_VGNAME_ARG, handle,
+ READ_FOR_UPDATE, handle,
restoremissing ? &_vgextend_restoremissing : &_vgextend_single);
destroy_processing_handle(cmd, handle);