summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2013-08-28 14:05:40 -0500
committerDavid Teigland <teigland@redhat.com>2014-01-23 14:12:45 -0600
commitaaea0de860208743ea7a2b75838394027f4cf986 (patch)
tree25d6c54f8ca04a92dc23ddb3cf4b3600058244b0
parent5e4647ec99b1de0923a311004e86649b50f81c1f (diff)
downloadlvm2-aaea0de860208743ea7a2b75838394027f4cf986.tar.gz
toollib: add ENABLE_ALL_VGS flag
The ENABLE_ALL_VGS flag is added to the command structure for commands that should process all vgs when they call process_each_vg or process_each_lv with no args. This will be used in later patches to process_each functions.
-rw-r--r--tools/commands.h31
-rw-r--r--tools/tools.h1
2 files changed, 19 insertions, 13 deletions
diff --git a/tools/commands.h b/tools/commands.h
index 938898b3b..052cd4c34 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -309,7 +309,7 @@ xx(lvcreate,
xx(lvdisplay,
"Display information about a logical volume",
- PERMITTED_READ_ONLY,
+ PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"lvdisplay\n"
"\t[-a|--all]\n"
"\t[-c|--colon]\n"
@@ -510,7 +510,7 @@ xx(lvresize,
xx(lvs,
"Display information about logical volumes",
- PERMITTED_READ_ONLY,
+ PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"lvs" "\n"
"\t[-a|--all]\n"
"\t[--aligned]\n"
@@ -543,7 +543,7 @@ xx(lvs,
xx(lvscan,
"List all logical volumes in all volume groups",
- PERMITTED_READ_ONLY,
+ PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"lvscan " "\n"
"\t[-a|--all]\n"
"\t[-b|--blockdevice] " "\n"
@@ -694,9 +694,14 @@ xx(pvdisplay,
ignoreskippedcluster_ARG, maps_ARG, noheadings_ARG, nosuffix_ARG,
options_ARG, separator_ARG, short_ARG, sort_ARG, unbuffered_ARG, units_ARG)
+/*
+ * pvmove needs ENABLE_ALL_VGS because it calls polldaemon which
+ * calls process_each_vg to find work.
+ */
+
xx(pvmove,
"Move extents from one physical volume to another",
- 0,
+ ENABLE_ALL_VGS,
"pvmove " "\n"
"\t[--abort]\n"
"\t[-A|--autobackup {y|n}]\n"
@@ -734,7 +739,7 @@ xx(pvremove,
xx(pvs,
"Display information about physical volumes",
- CACHE_VGMETADATA | PERMITTED_READ_ONLY,
+ CACHE_VGMETADATA | PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"pvs" "\n"
"\t[-a|--all]\n"
"\t[--aligned]\n"
@@ -791,7 +796,7 @@ xx(segtypes,
xx(vgcfgbackup,
"Backup volume group configuration(s)",
- PERMITTED_READ_ONLY,
+ PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"vgcfgbackup " "\n"
"\t[-d|--debug] " "\n"
"\t[-f|--file filename] " "\n"
@@ -823,7 +828,7 @@ xx(vgcfgrestore,
xx(vgchange,
"Change volume group attributes",
- CACHE_VGMETADATA | PERMITTED_READ_ONLY,
+ CACHE_VGMETADATA | PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"vgchange" "\n"
"\t[-A|--autobackup {y|n}] " "\n"
"\t[--alloc AllocationPolicy] " "\n"
@@ -867,7 +872,7 @@ xx(vgchange,
xx(vgck,
"Check the consistency of volume group(s)",
- 0,
+ ENABLE_ALL_VGS,
"vgck "
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
@@ -925,7 +930,7 @@ xx(vgcreate,
xx(vgdisplay,
"Display volume group information",
- PERMITTED_READ_ONLY,
+ PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"vgdisplay " "\n"
"\t[-A|--activevolumegroups]" "\n"
"\t[-c|--colon | -s|--short | -v|--verbose]" "\n"
@@ -964,7 +969,7 @@ xx(vgdisplay,
xx(vgexport,
"Unregister volume group(s) from the system",
- 0,
+ ENABLE_ALL_VGS,
"vgexport " "\n"
"\t[-a|--all] " "\n"
"\t[-d|--debug] " "\n"
@@ -1029,7 +1034,7 @@ xx(vgmerge,
xx(vgmknodes,
"Create the special files for volume group devices in /dev",
- 0,
+ ENABLE_ALL_VGS,
"vgmknodes\n"
"\t[-d|--debug]\n"
"\t[-h|--help]\n"
@@ -1093,7 +1098,7 @@ xx(vgrename,
xx(vgs,
"Display information about volume groups",
- PERMITTED_READ_ONLY,
+ PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"vgs" "\n"
"\t[--aligned]\n"
"\t[-a|--all]\n"
@@ -1125,7 +1130,7 @@ xx(vgs,
xx(vgscan,
"Search for all volume groups",
- PERMITTED_READ_ONLY,
+ PERMITTED_READ_ONLY | ENABLE_ALL_VGS,
"vgscan "
"\t[--cache]\n"
"\t[-d|--debug]\n"
diff --git a/tools/tools.h b/tools/tools.h
index a2bfe0d15..78fa7cefa 100644
--- a/tools/tools.h
+++ b/tools/tools.h
@@ -102,6 +102,7 @@ struct arg_value_group_list {
#define CACHE_VGMETADATA 0x00000001
#define PERMITTED_READ_ONLY 0x00000002
+#define ENABLE_ALL_VGS 0x00000004 /* run cmd on all vgs if none are named */
/* a register of the lvm commands */
struct command {