From c9b9077b44119db0bfd926730cb79ebf0990c980 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 27 Jun 2012 10:43:20 -0400 Subject: [PATCH] lvchange: add --activate ay (autoactivate) The same as for vgchange... --- WHATS_NEW | 1 + tools/commands.h | 2 +- tools/lvchange.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 481e8e3e3..ec554bf4e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.97 - =============================== + Add --activate ay to lvchange. Add --activate ay to pvscan. Add --activate ay to vgchange. Add support for volume autoactivation using lvmetad. diff --git a/tools/commands.h b/tools/commands.h index 21791f77b..b863c66cc 100644 --- a/tools/commands.h +++ b/tools/commands.h @@ -61,7 +61,7 @@ xx(lvchange, CACHE_VGMETADATA | PERMITTED_READ_ONLY, "lvchange\n" "\t[-A|--autobackup y|n]\n" - "\t[-a|--activate [e|l]y|n]\n" + "\t[-a|--activate [a|e|l]{y|n}]\n" "\t[--addtag Tag]\n" "\t[--alloc AllocationPolicy]\n" "\t[-C|--contiguous y|n]\n" diff --git a/tools/lvchange.c b/tools/lvchange.c index 4d040be50..9876847bb 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -136,6 +136,12 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv if (lv_is_cow(lv) && !lv_is_virtual_origin(origin_from_cow(lv))) lv = origin_from_cow(lv); + if (activate == CHANGE_AAY) { + if (!lv_passes_auto_activation_filter(cmd, lv)) + return 1; + activate = CHANGE_ALY; + } + if (activate == CHANGE_ALN) { log_verbose("Deactivating logical volume \"%s\" locally", lv->name);