master - tools: allow -S|--select for vgremove and lvremove
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=00744b053f395be79ab1cb80fdf7342548aa79e2 Commit: 00744b053f395be79ab1cb80fdf7342548aa79e2 Parent: f784c60cd65d14d107e957338af041c3a507ef8d Author: Peter Rajnoha <[email protected]> AuthorDate: Fri Dec 12 09:34:50 2014 +0100 Committer: Peter Rajnoha <[email protected]> CommitterDate: Tue Feb 10 16:08:42 2015 +0100
tools: allow -S|--select for vgremove and lvremove
--- WHATS_NEW | 1 + tools/commands.h | 10 ++++++---- tools/lvremove.c | 5 +++-- tools/reporter.c | 2 +- tools/vgremove.c | 5 +++-- 5 files changed, 14 insertions(+), 9 deletions(-)
WHATS_NEW +1 -0
@@ -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.
tools/commands.h +6 -4
@@ -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",
tools/lvremove.c +3 -2
@@ -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 ; }
tools/reporter.c +1 -1
@@ -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 ;
tools/vgremove.c +3 -2
@@ -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 ; }