From 178ff2becc6f22db3c68aaa89b7839d47c095705 Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Tue, 26 Oct 2010 01:37:59 +0000 Subject: Fix vgchange to process -a, --refresh, --monitor and --poll like lvchange. Simultaneous -a and --refresh is not valid. poll+monitor are valid together with or without -ay* (but not with -an*) No longer print polling results summary if no LVs in the VG were polled. --- tools/lvchange.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/lvchange.c') diff --git a/tools/lvchange.c b/tools/lvchange.c index 5ac223ab..cd7a06f0 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -715,7 +715,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv, int lvchange(struct cmd_context *cmd, int argc, char **argv) { - int update = /* options other than -a, --refresh or --monitor */ + int update = /* options other than -a, --refresh, --monitor or --poll */ arg_count(cmd, contiguous_ARG) || arg_count(cmd, permission_ARG) || arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG) || arg_count(cmd, addtag_ARG) || arg_count(cmd, deltag_ARG) || @@ -732,6 +732,10 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv) return EINVALID_CMD_LINE; } + if (arg_count(cmd, available_ARG) && arg_count(cmd, refresh_ARG)) { + log_error("Only one of -a and --refresh permitted."); + return EINVALID_CMD_LINE; + } if ((arg_count(cmd, ignorelockingfailure_ARG) || arg_count(cmd, sysinit_ARG)) && update) { -- cgit