1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

args: add --activate synonym for --available arg

We're refererring to 'activation' all over the code and we're talking
about 'LVs being activated' all the time so let's use 'activation/activate'
everywhere for clarity and consistency (still providing the old
'available' keyword as a synonym for backward compatibility with
existing environments).
This commit is contained in:
Peter Rajnoha 2012-06-27 07:48:31 -04:00
parent 07a25c249b
commit 2729720fd3
13 changed files with 66 additions and 64 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.97 - Version 2.02.97 -
=============================== ===============================
Add --activate synonym for --available arg and prefer --activate.
Never issue discards when LV extents are being reconfigured, not deleted. Never issue discards when LV extents are being reconfigured, not deleted.
Allow release_lv_segment_area to fail as functions it calls can fail. Allow release_lv_segment_area to fail as functions it calls can fail.
Open device read-only to obtain readahead value. Open device read-only to obtain readahead value.

View File

@ -563,11 +563,11 @@ int update_pool_lv(struct logical_volume *lv, int activate);
* Activation options * Activation options
*/ */
typedef enum { typedef enum {
CHANGE_AY = 0, CHANGE_AY = 0, /* activate */
CHANGE_AN = 1, CHANGE_AN = 1, /* deactivate */
CHANGE_AE = 2, CHANGE_AE = 2, /* activate exclusively */
CHANGE_ALY = 3, CHANGE_ALY = 3, /* activate locally */
CHANGE_ALN = 4 CHANGE_ALN = 4 /* deactivate locally */
} activation_change_t; } activation_change_t;
/* FIXME: refactor and reduce the size of this struct! */ /* FIXME: refactor and reduce the size of this struct! */

View File

@ -7,7 +7,7 @@ lvchange \- change attributes of a logical volume
.IR Tag ] .IR Tag ]
.RB [ \-A | \-\-autobackup .RB [ \-A | \-\-autobackup
.RI { y | n }] .RI { y | n }]
.RB [ \-a | \-\-available .RB [ \-a | \-\-activate
.RI [ e | l ]{ y | n }] .RI [ e | l ]{ y | n }]
.RB [ \-\-alloc .RB [ \-\-alloc
.IR AllocationPolicy ] .IR AllocationPolicy ]
@ -46,7 +46,7 @@ including making them known to the kernel ready for use.
.SH OPTIONS .SH OPTIONS
See \fBlvm\fP(8) for common options. See \fBlvm\fP(8) for common options.
.TP .TP
.BR \-a ", " \-\-available " [" \fIe | \fIl ]{ \fIy | \fIn } .BR \-a ", " \-\-activate " [" \fIe | \fIl ]{ \fIy | \fIn }
Controls the availability of the logical volumes for use. Controls the availability of the logical volumes for use.
Communicates with the kernel device-mapper driver via Communicates with the kernel device-mapper driver via
libdevmapper to activate (\-ay) or deactivate (\-an) the libdevmapper to activate (\-ay) or deactivate (\-an) the

View File

@ -7,7 +7,7 @@ lvcreate \- create a logical volume in an existing volume group
.IR Tag ] .IR Tag ]
.RB [ \-\-alloc .RB [ \-\-alloc
.IR AllocationPolicy ] .IR AllocationPolicy ]
.RB [ \-a | \-\-available .RB [ \-a | \-\-activate
.RI [ e | l ]{ y | n }] .RI [ e | l ]{ y | n }]
.RB [ \-A | \-\-autobackup .RB [ \-A | \-\-autobackup
.RI { y | n }] .RI { y | n }]
@ -107,7 +107,7 @@ See
.BR lvm (8) .BR lvm (8)
for common options. for common options.
.TP .TP
.IR \fB\-a ", " \fB\-\-available " {" y | n | ey | en | ly | ln } .IR \fB\-a ", " \fB\-\-activate " {" y | n | ey | en | ly | ln }
Controls the availability of the Logical Volumes for immediate use after Controls the availability of the Logical Volumes for immediate use after
the command finishes running. the command finishes running.
By default, new Logical Volumes are activated automatically (\fB-a\fIy\fR). By default, new Logical Volumes are activated automatically (\fB-a\fIy\fR).

View File

@ -9,7 +9,7 @@ vgchange \- change attributes of a volume group
.IR AllocationPolicy ] .IR AllocationPolicy ]
.RB [ \-A | \-\-autobackup .RB [ \-A | \-\-autobackup
.RI { y | n }] .RI { y | n }]
.RB [ \-a | \-\-available .RB [ \-a | \-\-activate
.RI [ e | l ] .RI [ e | l ]
.RI { y | n }] .RI { y | n }]
.RB [ \-\-monitor .RB [ \-\-monitor
@ -64,7 +64,7 @@ Controls automatic backup of metadata after the change. See
.BR vgcfgbackup (8). .BR vgcfgbackup (8).
Default is yes. Default is yes.
.TP .TP
.BR \-a ", " \-\-available " [" \fIe | \fIl ]{ \fIy | \fIn } .BR \-a ", " \-\-activate " [" \fIe | \fIl ]{ \fIy | \fIn }
Controls the availability of the logical volumes in the volume Controls the availability of the logical volumes in the volume
group for input/output. group for input/output.
In other words, makes the logical volumes known/unknown to the kernel. In other words, makes the logical volumes known/unknown to the kernel.

View File

@ -79,11 +79,12 @@ arg(thinpool_ARG, '\0', "thinpool", string_arg, 0)
/* Allow some variations */ /* Allow some variations */
arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0) arg(resizable_ARG, '\0', "resizable", yes_no_arg, 0)
arg(allocation_ARG, '\0', "allocation", yes_no_arg, 0) arg(allocation_ARG, '\0', "allocation", yes_no_arg, 0)
arg(available_ARG, '\0', "available", activation_arg, 0)
/* /*
* ... and now the short args. * ... and now the short args.
*/ */
arg(available_ARG, 'a', "available", yes_no_excl_arg, 0) arg(activate_ARG, 'a', "activate", activation_arg, 0)
arg(all_ARG, 'a', "all", NULL, 0) arg(all_ARG, 'a', "all", NULL, 0)
arg(autobackup_ARG, 'A', "autobackup", yes_no_arg, 0) arg(autobackup_ARG, 'A', "autobackup", yes_no_arg, 0)
arg(activevolumegroups_ARG, 'A', "activevolumegroups", NULL, 0) arg(activevolumegroups_ARG, 'A', "activevolumegroups", NULL, 0)

View File

@ -61,7 +61,7 @@ xx(lvchange,
CACHE_VGMETADATA | PERMITTED_READ_ONLY, CACHE_VGMETADATA | PERMITTED_READ_ONLY,
"lvchange\n" "lvchange\n"
"\t[-A|--autobackup y|n]\n" "\t[-A|--autobackup y|n]\n"
"\t[-a|--available [e|l]y|n]\n" "\t[-a|--activate [e|l]y|n]\n"
"\t[--addtag Tag]\n" "\t[--addtag Tag]\n"
"\t[--alloc AllocationPolicy]\n" "\t[--alloc AllocationPolicy]\n"
"\t[-C|--contiguous y|n]\n" "\t[-C|--contiguous y|n]\n"
@ -87,11 +87,11 @@ xx(lvchange,
"\t[--version]" "\n" "\t[--version]" "\n"
"\tLogicalVolume[Path] [LogicalVolume[Path]...]\n", "\tLogicalVolume[Path] [LogicalVolume[Path]...]\n",
alloc_ARG, autobackup_ARG, available_ARG, contiguous_ARG, force_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG, contiguous_ARG,
ignorelockingfailure_ARG, ignoremonitoring_ARG, major_ARG, minor_ARG, force_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG, major_ARG,
monitor_ARG, noudevsync_ARG, partial_ARG, permission_ARG, persistent_ARG, minor_ARG, monitor_ARG, noudevsync_ARG, partial_ARG, permission_ARG,
poll_ARG, readahead_ARG, resync_ARG, refresh_ARG, addtag_ARG, deltag_ARG, persistent_ARG, poll_ARG, readahead_ARG, resync_ARG, refresh_ARG,
sysinit_ARG, test_ARG, yes_ARG) addtag_ARG, deltag_ARG, sysinit_ARG, test_ARG, yes_ARG)
xx(lvconvert, xx(lvconvert,
"Change logical volume layout", "Change logical volume layout",
@ -159,7 +159,7 @@ xx(lvcreate,
0, 0,
"lvcreate " "\n" "lvcreate " "\n"
"\t[-A|--autobackup {y|n}]\n" "\t[-A|--autobackup {y|n}]\n"
"\t[-a|--available [e|l]y|n]\n" "\t[-a|--activate [e|l]y|n]\n"
"\t[--addtag Tag]\n" "\t[--addtag Tag]\n"
"\t[--alloc AllocationPolicy]\n" "\t[--alloc AllocationPolicy]\n"
"\t[-C|--contiguous {y|n}]\n" "\t[-C|--contiguous {y|n}]\n"
@ -214,13 +214,13 @@ xx(lvcreate,
"\t[PhysicalVolumePath...]\n\n", "\t[PhysicalVolumePath...]\n\n",
addtag_ARG, alloc_ARG, autobackup_ARG, available_ARG, chunksize_ARG, addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG, available_ARG,
contiguous_ARG, corelog_ARG, extents_ARG, ignoremonitoring_ARG, major_ARG, chunksize_ARG, contiguous_ARG, corelog_ARG, extents_ARG,
minor_ARG, mirrorlog_ARG, mirrors_ARG, monitor_ARG, name_ARG, nosync_ARG, ignoremonitoring_ARG, major_ARG, minor_ARG, mirrorlog_ARG, mirrors_ARG,
noudevsync_ARG, permission_ARG, persistent_ARG, readahead_ARG, monitor_ARG, name_ARG, nosync_ARG, noudevsync_ARG, permission_ARG,
regionsize_ARG, size_ARG, snapshot_ARG, stripes_ARG, stripesize_ARG, persistent_ARG, readahead_ARG, regionsize_ARG, size_ARG, snapshot_ARG,
test_ARG, thin_ARG, thinpool_ARG, type_ARG, virtualoriginsize_ARG, stripes_ARG, stripesize_ARG, test_ARG, thin_ARG, thinpool_ARG, type_ARG,
poolmetadatasize_ARG, virtualsize_ARG, zero_ARG) virtualoriginsize_ARG, poolmetadatasize_ARG, virtualsize_ARG, zero_ARG)
xx(lvdisplay, xx(lvdisplay,
"Display information about a logical volume", "Display information about a logical volume",
@ -742,7 +742,7 @@ xx(vgchange,
"\t[-u|--uuid] " "\n" "\t[-u|--uuid] " "\n"
"\t[-v|--verbose] " "\n" "\t[-v|--verbose] " "\n"
"\t[--version]" "\n" "\t[--version]" "\n"
"\t{-a|--available [e|l]{y|n} |" "\n" "\t{-a|--activate [e|l]{y|n} |" "\n"
"\t -c|--clustered {y|n} |" "\n" "\t -c|--clustered {y|n} |" "\n"
"\t -x|--resizeable {y|n} |" "\n" "\t -x|--resizeable {y|n} |" "\n"
"\t -l|--logicalvolume MaxLogicalVolumes |" "\n" "\t -l|--logicalvolume MaxLogicalVolumes |" "\n"
@ -752,11 +752,11 @@ xx(vgchange,
"\t --deltag Tag}\n" "\t --deltag Tag}\n"
"\t[VolumeGroupName...]\n", "\t[VolumeGroupName...]\n",
addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG, available_ARG, addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG, activate_ARG,
clustered_ARG, deltag_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG, available_ARG, clustered_ARG, deltag_ARG, ignorelockingfailure_ARG,
logicalvolume_ARG, maxphysicalvolumes_ARG, monitor_ARG, noudevsync_ARG, ignoremonitoring_ARG, logicalvolume_ARG, maxphysicalvolumes_ARG,
metadatacopies_ARG, vgmetadatacopies_ARG, partial_ARG, monitor_ARG, noudevsync_ARG, metadatacopies_ARG, vgmetadatacopies_ARG,
physicalextentsize_ARG, poll_ARG, refresh_ARG, resizeable_ARG, partial_ARG, physicalextentsize_ARG, poll_ARG, refresh_ARG, resizeable_ARG,
resizable_ARG, sysinit_ARG, test_ARG, uuid_ARG) resizable_ARG, sysinit_ARG, test_ARG, uuid_ARG)
xx(vgck, xx(vgck,

View File

@ -127,12 +127,11 @@ static int lvchange_background_polling(struct cmd_context *cmd,
return 1; return 1;
} }
static int lvchange_availability(struct cmd_context *cmd, static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv)
struct logical_volume *lv)
{ {
int activate; int activate;
activate = arg_uint_value(cmd, available_ARG, 0); activate = arg_uint_value(cmd, activate_ARG, 0);
if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv))) if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv)))
lv = origin_from_cow(lv); lv = origin_from_cow(lv);
@ -556,7 +555,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
} }
if (lv_is_cow(lv) && !lv_is_virtual_origin(origin = origin_from_cow(lv)) && if (lv_is_cow(lv) && !lv_is_virtual_origin(origin = origin_from_cow(lv)) &&
arg_count(cmd, available_ARG)) { arg_count(cmd, activate_ARG)) {
if (origin->origin_count < 2) if (origin->origin_count < 2)
snaps_msg[0] = '\0'; snaps_msg[0] = '\0';
else if (dm_snprintf(snaps_msg, sizeof(snaps_msg), else if (dm_snprintf(snaps_msg, sizeof(snaps_msg),
@ -577,7 +576,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
if (lv->status & PVMOVE) { if (lv->status & PVMOVE) {
log_error("Unable to change pvmove LV %s", lv->name); log_error("Unable to change pvmove LV %s", lv->name);
if (arg_count(cmd, available_ARG)) if (arg_count(cmd, activate_ARG))
log_error("Use 'pvmove --abort' to abandon a pvmove"); log_error("Use 'pvmove --abort' to abandon a pvmove");
return ECMD_FAILED; return ECMD_FAILED;
} }
@ -594,7 +593,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
} }
/* If LV is sparse, activate origin instead */ /* If LV is sparse, activate origin instead */
if (arg_count(cmd, available_ARG) && lv_is_cow(lv) && if (arg_count(cmd, activate_ARG) && lv_is_cow(lv) &&
lv_is_virtual_origin(origin = origin_from_cow(lv))) lv_is_virtual_origin(origin = origin_from_cow(lv)))
lv = origin; lv = origin;
@ -696,9 +695,9 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
return ECMD_FAILED; return ECMD_FAILED;
} }
/* availability change */ /* activation change */
if (arg_count(cmd, available_ARG)) { if (arg_count(cmd, activate_ARG)) {
if (!lvchange_availability(cmd, lv)) { if (!_lvchange_activate(cmd, lv)) {
stack; stack;
return ECMD_FAILED; return ECMD_FAILED;
} }
@ -710,7 +709,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
return ECMD_FAILED; return ECMD_FAILED;
} }
if (!arg_count(cmd, available_ARG) && if (!arg_count(cmd, activate_ARG) &&
!arg_count(cmd, refresh_ARG) && !arg_count(cmd, refresh_ARG) &&
arg_count(cmd, monitor_ARG)) { arg_count(cmd, monitor_ARG)) {
if (!lvchange_monitoring(cmd, lv)) { if (!lvchange_monitoring(cmd, lv)) {
@ -719,7 +718,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
} }
} }
if (!arg_count(cmd, available_ARG) && if (!arg_count(cmd, activate_ARG) &&
!arg_count(cmd, refresh_ARG) && !arg_count(cmd, refresh_ARG) &&
arg_count(cmd, poll_ARG)) { arg_count(cmd, poll_ARG)) {
if (!lvchange_background_polling(cmd, lv)) { if (!lvchange_background_polling(cmd, lv)) {
@ -745,7 +744,7 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, resync_ARG) || arg_count(cmd, alloc_ARG); arg_count(cmd, resync_ARG) || arg_count(cmd, alloc_ARG);
if (!update && if (!update &&
!arg_count(cmd, available_ARG) && !arg_count(cmd, refresh_ARG) && !arg_count(cmd, activate_ARG) && !arg_count(cmd, refresh_ARG) &&
!arg_count(cmd, monitor_ARG) && !arg_count(cmd, poll_ARG)) { !arg_count(cmd, monitor_ARG) && !arg_count(cmd, poll_ARG)) {
log_error("Need 1 or more of -a, -C, -M, -p, -r, " log_error("Need 1 or more of -a, -C, -M, -p, -r, "
"--resync, --refresh, --alloc, --addtag, --deltag, " "--resync, --refresh, --alloc, --addtag, --deltag, "
@ -753,7 +752,7 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
} }
if (arg_count(cmd, available_ARG) && arg_count(cmd, refresh_ARG)) { if (arg_count(cmd, activate_ARG) && arg_count(cmd, refresh_ARG)) {
log_error("Only one of -a and --refresh permitted."); log_error("Only one of -a and --refresh permitted.");
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
} }

View File

@ -560,11 +560,11 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
unsigned pagesize; unsigned pagesize;
lp->activate = (activation_change_t) lp->activate = (activation_change_t)
arg_uint_value(cmd, available_ARG, CHANGE_AY); arg_uint_value(cmd, activate_ARG, CHANGE_AY);
if (lp->activate == CHANGE_AN || lp->activate == CHANGE_ALN) { if (lp->activate == CHANGE_AN || lp->activate == CHANGE_ALN) {
if (lp->zero && !seg_is_thin(lp)) { if (lp->zero && !seg_is_thin(lp)) {
log_error("--available n requires --zero n"); log_error("--activate n requires --zero n");
return 0; return 0;
} }
} }

View File

@ -172,7 +172,7 @@ int yes_no_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_value
return 1; return 1;
} }
int yes_no_excl_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_values *av) int activation_arg(struct cmd_context *cmd __attribute__((unused)), struct arg_values *av)
{ {
av->sign = SIGN_NONE; av->sign = SIGN_NONE;
av->percent = PERCENT_NONE; av->percent = PERCENT_NONE;
@ -889,7 +889,8 @@ static int _get_settings(struct cmd_context *cmd)
if (!_merge_synonym(cmd, resizable_ARG, resizeable_ARG) || if (!_merge_synonym(cmd, resizable_ARG, resizeable_ARG) ||
!_merge_synonym(cmd, allocation_ARG, allocatable_ARG) || !_merge_synonym(cmd, allocation_ARG, allocatable_ARG) ||
!_merge_synonym(cmd, allocation_ARG, resizeable_ARG) || !_merge_synonym(cmd, allocation_ARG, resizeable_ARG) ||
!_merge_synonym(cmd, virtualoriginsize_ARG, virtualsize_ARG)) !_merge_synonym(cmd, virtualoriginsize_ARG, virtualsize_ARG) ||
!_merge_synonym(cmd, available_ARG, activate_ARG))
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
if ((!strncmp(cmd->command->name, "pv", 2) && if ((!strncmp(cmd->command->name, "pv", 2) &&

View File

@ -129,7 +129,7 @@ int process_each_lv_in_vg(struct cmd_context *cmd,
/* Skip availability change for non-virt snaps when processing all LVs */ /* Skip availability change for non-virt snaps when processing all LVs */
/* FIXME: pass process_all to process_single_lv() */ /* FIXME: pass process_all to process_single_lv() */
if (process_all && arg_count(cmd, available_ARG) && if (process_all && arg_count(cmd, activate_ARG) &&
lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv))) lv_is_cow(lvl->lv) && !lv_is_virtual_origin(origin_from_cow(lvl->lv)))
continue; continue;

View File

@ -138,7 +138,7 @@ void usage(const char *name);
/* the argument verify/normalise functions */ /* the argument verify/normalise functions */
int yes_no_arg(struct cmd_context *cmd, struct arg_values *av); int yes_no_arg(struct cmd_context *cmd, struct arg_values *av);
int yes_no_excl_arg(struct cmd_context *cmd, struct arg_values *av); int activation_arg(struct cmd_context *cmd, struct arg_values *av);
int size_kb_arg(struct cmd_context *cmd, struct arg_values *av); int size_kb_arg(struct cmd_context *cmd, struct arg_values *av);
int size_mb_arg(struct cmd_context *cmd, struct arg_values *av); int size_mb_arg(struct cmd_context *cmd, struct arg_values *av);
int int_arg(struct cmd_context *cmd, struct arg_values *av); int int_arg(struct cmd_context *cmd, struct arg_values *av);

View File

@ -211,10 +211,10 @@ static int _vgchange_background_polling(struct cmd_context *cmd, struct volume_g
return 1; return 1;
} }
static int _vgchange_available(struct cmd_context *cmd, struct volume_group *vg) static int _vgchange_activate(struct cmd_context *cmd, struct volume_group *vg)
{ {
int lv_open, active, monitored = 0; int lv_open, active, monitored = 0;
int available, r = 1; int activate_arg, r = 1;
int activate = 1; int activate = 1;
/* /*
@ -223,9 +223,9 @@ static int _vgchange_available(struct cmd_context *cmd, struct volume_group *vg)
*/ */
cmd->handles_missing_pvs = 1; cmd->handles_missing_pvs = 1;
available = arg_uint_value(cmd, available_ARG, 0); activate_arg = arg_uint_value(cmd, activate_ARG, 0);
if ((available == CHANGE_AN) || (available == CHANGE_ALN)) if ((activate_arg == CHANGE_AN) || (activate_arg == CHANGE_ALN))
activate = 0; activate = 0;
/* FIXME: Force argument to deactivate them? */ /* FIXME: Force argument to deactivate them? */
@ -252,7 +252,7 @@ static int _vgchange_available(struct cmd_context *cmd, struct volume_group *vg)
} }
} }
if (!_activate_lvs_in_vg(cmd, vg, available)) if (!_activate_lvs_in_vg(cmd, vg, activate_arg))
r = 0; r = 0;
/* Print message only if there was not found a missing VG */ /* Print message only if there was not found a missing VG */
@ -508,8 +508,8 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
log_print("Volume group \"%s\" successfully changed", vg->name); log_print("Volume group \"%s\" successfully changed", vg->name);
} }
if (arg_count(cmd, available_ARG)) { if (arg_count(cmd, activate_ARG)) {
if (!_vgchange_available(cmd, vg)) if (!_vgchange_activate(cmd, vg))
return ECMD_FAILED; return ECMD_FAILED;
} }
@ -519,7 +519,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
return ECMD_FAILED; return ECMD_FAILED;
} }
if (!arg_count(cmd, available_ARG) && if (!arg_count(cmd, activate_ARG) &&
!arg_count(cmd, refresh_ARG) && !arg_count(cmd, refresh_ARG) &&
arg_count(cmd, monitor_ARG)) { arg_count(cmd, monitor_ARG)) {
/* -ay* will have already done monitoring changes */ /* -ay* will have already done monitoring changes */
@ -551,7 +551,7 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
arg_count(cmd, vgmetadatacopies_ARG); arg_count(cmd, vgmetadatacopies_ARG);
if (!update && if (!update &&
!arg_count(cmd, available_ARG) && !arg_count(cmd, activate_ARG) &&
!arg_count(cmd, monitor_ARG) && !arg_count(cmd, monitor_ARG) &&
!arg_count(cmd, poll_ARG) && !arg_count(cmd, poll_ARG) &&
!arg_count(cmd, refresh_ARG)) { !arg_count(cmd, refresh_ARG)) {
@ -562,7 +562,7 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
} }
if (arg_count(cmd, available_ARG) && arg_count(cmd, refresh_ARG)) { if (arg_count(cmd, activate_ARG) && arg_count(cmd, refresh_ARG)) {
log_error("Only one of -a and --refresh permitted."); log_error("Only one of -a and --refresh permitted.");
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
} }
@ -573,9 +573,9 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
} }
if (arg_count(cmd, available_ARG) && if (arg_count(cmd, activate_ARG) &&
(arg_count(cmd, monitor_ARG) || arg_count(cmd, poll_ARG))) { (arg_count(cmd, monitor_ARG) || arg_count(cmd, poll_ARG))) {
int activate = arg_uint_value(cmd, available_ARG, 0); int activate = arg_uint_value(cmd, activate_ARG, 0);
if (activate == CHANGE_AN || activate == CHANGE_ALN) { if (activate == CHANGE_AN || activate == CHANGE_ALN) {
log_error("Only -ay* allowed with --monitor or --poll."); log_error("Only -ay* allowed with --monitor or --poll.");
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
@ -587,7 +587,7 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;
} }
if (arg_count(cmd, available_ARG) == 1 if (arg_count(cmd, activate_ARG) == 1
&& arg_count(cmd, autobackup_ARG)) { && arg_count(cmd, autobackup_ARG)) {
log_error("-A option not necessary with -a option"); log_error("-A option not necessary with -a option");
return EINVALID_CMD_LINE; return EINVALID_CMD_LINE;