1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tools: allow -S|--select for vgchange, lvchange and pvchange

This commit is contained in:
Peter Rajnoha 2014-12-03 10:03:48 +01:00
parent d6c8f0de28
commit f784c60cd6
4 changed files with 16 additions and 12 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.117 -
====================================
Add support for -S/--select to vgchange,lvchange and pvchange.
Add infrastructure to support selection for non-reporting tools.
Add LVM_COMMAND_PROFILE env var to set default command profile name to use.
set CLOEXEC flag on file descriptors originating in libdaemon

View File

@ -135,6 +135,7 @@ xx(lvchange,
"\t[-r|--readahead ReadAheadSectors|auto|none]\n"
"\t[--refresh]\n"
"\t[--resync]\n"
"\t[-S|--select Selection]\n"
"\t[--sysinit]\n"
"\t[-t|--test]\n"
"\t[-v|--verbose]\n"
@ -144,17 +145,16 @@ xx(lvchange,
"\tLogicalVolume[Path] [LogicalVolume[Path]...]\n",
activationmode_ARG, addtag_ARG, alloc_ARG, autobackup_ARG, activate_ARG,
available_ARG,
cachepolicy_ARG, cachesettings_ARG, contiguous_ARG, deltag_ARG, discards_ARG,
detachprofile_ARG, errorwhenfull_ARG, force_ARG,
available_ARG, cachepolicy_ARG, cachesettings_ARG, contiguous_ARG, deltag_ARG,
discards_ARG, detachprofile_ARG, errorwhenfull_ARG, force_ARG,
ignorelockingfailure_ARG, ignoremonitoring_ARG, ignoreactivationskip_ARG,
ignoreskippedcluster_ARG, major_ARG, metadataprofile_ARG, minor_ARG,
monitor_ARG, minrecoveryrate_ARG, maxrecoveryrate_ARG, noudevsync_ARG,
partial_ARG, permission_ARG, persistent_ARG, poll_ARG,
raidminrecoveryrate_ARG, raidmaxrecoveryrate_ARG, raidsyncaction_ARG,
raidwritebehind_ARG, raidwritemostly_ARG, readahead_ARG, resync_ARG,
refresh_ARG, setactivationskip_ARG, syncaction_ARG, sysinit_ARG, test_ARG,
writebehind_ARG, writemostly_ARG, zero_ARG)
refresh_ARG, select_ARG, setactivationskip_ARG, syncaction_ARG, sysinit_ARG,
test_ARG, writebehind_ARG, writemostly_ARG, zero_ARG)
#define COMMON_OPTS \
"\t[--commandprofile ProfileName] [-d|--debug] [-h|-?|--help]\n" \
@ -638,6 +638,7 @@ xx(pvchange,
"\t[-d|--debug]\n"
"\t[-f|--force]\n"
"\t[-h|--help]\n"
"\t[-S|--select Selection]\n"
"\t[-t|--test]\n"
"\t[-u|--uuid]\n"
"\t[-x|--allocatable y|n]\n"
@ -649,7 +650,7 @@ xx(pvchange,
"\t[PhysicalVolumePath...]\n",
all_ARG, allocatable_ARG, allocation_ARG, autobackup_ARG, deltag_ARG,
addtag_ARG, force_ARG, metadataignore_ARG, test_ARG, uuid_ARG)
addtag_ARG, force_ARG, metadataignore_ARG, select_ARG, test_ARG, uuid_ARG)
xx(pvresize,
"Resize physical volume(s)",
@ -945,6 +946,7 @@ xx(vgchange,
"\t[--poll {y|n}]\n"
"\t[--noudevsync]\n"
"\t[--refresh]\n"
"\t[-S|--select Selection]\n"
"\t[--sysinit]\n"
"\t[-t|--test]\n"
"\t[-u|--uuid]\n"
@ -962,13 +964,13 @@ xx(vgchange,
"\t[VolumeGroupName...]\n",
activationmode_ARG, addtag_ARG, alloc_ARG, allocation_ARG, autobackup_ARG,
activate_ARG,
available_ARG, clustered_ARG, deltag_ARG, detachprofile_ARG,
activate_ARG, available_ARG, clustered_ARG, deltag_ARG, detachprofile_ARG,
ignoreactivationskip_ARG, ignorelockingfailure_ARG, ignoremonitoring_ARG,
ignoreskippedcluster_ARG, logicalvolume_ARG, maxphysicalvolumes_ARG,
metadataprofile_ARG, monitor_ARG, noudevsync_ARG, metadatacopies_ARG,
vgmetadatacopies_ARG, partial_ARG, physicalextentsize_ARG, poll_ARG,
refresh_ARG, resizeable_ARG, resizable_ARG, sysinit_ARG, test_ARG, uuid_ARG)
refresh_ARG, resizeable_ARG, resizable_ARG, select_ARG, sysinit_ARG,
test_ARG, uuid_ARG)
xx(vgck,
"Check the consistency of volume group(s)",

View File

@ -1152,8 +1152,8 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
if (!update || !update_partial_unsafe)
cmd->handles_missing_pvs = 1;
if (!argc) {
log_error("Please give logical volume path(s)");
if (!argc && !arg_is_set(cmd, select_ARG)) {
log_error("Please give logical volume path(s) or provide selection criteria.");
return EINVALID_CMD_LINE;
}

View File

@ -177,7 +177,8 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv)
}
if (!(arg_count(cmd, all_ARG)) && !argc && !handle->internal_report_for_select) {
log_error("Please give a physical volume path");
log_error("Please give a physical volume path "
"or use -S for selection.");
r = EINVALID_CMD_LINE;
goto out;
}