mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-25 18:50:51 +03:00
tools: allow -S|--select for vgremove and lvremove
This commit is contained in:
parent
f784c60cd6
commit
00744b053f
@ -1,5 +1,6 @@
|
||||
Version 2.02.117 -
|
||||
====================================
|
||||
Add support for -S/--select to vgremove and lvremove.
|
||||
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.
|
||||
|
@ -512,7 +512,7 @@ xx(lvreduce,
|
||||
|
||||
xx(lvremove,
|
||||
"Remove logical volume(s) from the system",
|
||||
0,
|
||||
ALL_VGS_IS_DEFAULT, /* all VGs only with --select */
|
||||
"lvremove\n"
|
||||
"\t[-A|--autobackup y|n]\n"
|
||||
"\t[--commandprofile ProfileName]\n"
|
||||
@ -520,12 +520,13 @@ xx(lvremove,
|
||||
"\t[-f|--force]\n"
|
||||
"\t[-h|--help]\n"
|
||||
"\t[--noudevsync]\n"
|
||||
"\t[-S|--select Selection]\n"
|
||||
"\t[-t|--test]\n"
|
||||
"\t[-v|--verbose]\n"
|
||||
"\t[--version]\n"
|
||||
"\tLogicalVolume[Path] [LogicalVolume[Path]...]\n",
|
||||
|
||||
autobackup_ARG, force_ARG, noudevsync_ARG, test_ARG)
|
||||
autobackup_ARG, force_ARG, noudevsync_ARG, select_ARG, test_ARG)
|
||||
|
||||
xx(lvrename,
|
||||
"Rename a logical volume",
|
||||
@ -1186,19 +1187,20 @@ xx(vgreduce,
|
||||
|
||||
xx(vgremove,
|
||||
"Remove volume group(s)",
|
||||
0,
|
||||
ALL_VGS_IS_DEFAULT, /* all VGs only with select */
|
||||
"vgremove\n"
|
||||
"\t[--commandprofile ProfileName]\n"
|
||||
"\t[-d|--debug]\n"
|
||||
"\t[-f|--force]\n"
|
||||
"\t[-h|--help]\n"
|
||||
"\t[--noudevsync]\n"
|
||||
"\t[-S|--select Selection]\n"
|
||||
"\t[-t|--test]\n"
|
||||
"\t[-v|--verbose]\n"
|
||||
"\t[--version]\n"
|
||||
"\tVolumeGroupName [VolumeGroupName...]\n",
|
||||
|
||||
force_ARG, noudevsync_ARG, test_ARG)
|
||||
force_ARG, noudevsync_ARG, select_ARG, test_ARG)
|
||||
|
||||
xx(vgrename,
|
||||
"Rename a volume group",
|
||||
|
@ -17,8 +17,9 @@
|
||||
|
||||
int lvremove(struct cmd_context *cmd, int argc, char **argv)
|
||||
{
|
||||
if (!argc) {
|
||||
log_error("Please enter one or more logical volume paths");
|
||||
if (!argc && !arg_is_set(cmd, select_ARG)) {
|
||||
log_error("Please enter one or more logical volume paths "
|
||||
"or use -S for selection.");
|
||||
return EINVALID_CMD_LINE;
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ int report_for_selection(struct selection_handle *sh,
|
||||
static const char *incorrect_report_type_msg = "report_for_selection: incorrect report type";
|
||||
int args_are_pvs = sh->orig_report_type == PVS;
|
||||
int do_lv_info, do_lv_seg_status;
|
||||
struct processing_handle handle = { .internal_report = 0,
|
||||
struct processing_handle handle = { .internal_report_for_select = 0,
|
||||
.selection_handle = sh,
|
||||
.custom_handle = NULL };
|
||||
int r = 0;
|
||||
|
@ -69,8 +69,9 @@ int vgremove(struct cmd_context *cmd, int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!argc) {
|
||||
log_error("Please enter one or more volume group paths");
|
||||
if (!argc && !arg_is_set(cmd, select_ARG)) {
|
||||
log_error("Please enter one or more volume group paths "
|
||||
"or use -S for selection.");
|
||||
return EINVALID_CMD_LINE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user