summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2012-07-10 13:49:46 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2012-07-10 14:01:33 +0200
commitcd8ea8b437de53f0019bd69d542a7d01f3d5b7d3 (patch)
treed26c30313bf3ff302ca22873f86b1d8958802f52 /tools
parent8767435ef847831455fadc1f7e8f4d2d94aef0d5 (diff)
downloadlvm2-cd8ea8b437de53f0019bd69d542a7d01f3d5b7d3.tar.gz
lvm2-cd8ea8b437de53f0019bd69d542a7d01f3d5b7d3.tar.xz
lvm2-cd8ea8b437de53f0019bd69d542a7d01f3d5b7d3.zip
activate: skip manual activation for --sysinit -aay
When --sysinit -a ay is used with vg/lvchange and lvmetad is up and running, we should skip manual activation as that would be a useless step - all volumes are autoactivated once all the PVs for a VG are present. If lvmetad is not active at the time of the vgchange --sysinit -a ay call, the activation proceeds in standard 'manual' way. This way, we can still have vg/lvchange --sysinit -a ay called unconditionally in system initialization scripts no matter if lvmetad is used or not.
Diffstat (limited to 'tools')
-rw-r--r--tools/lvchange.c7
-rw-r--r--tools/vgchange.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 9876847b..9054ac78 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -798,6 +798,13 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if (arg_count(cmd, sysinit_ARG) && lvmetad_active() &&
+ arg_uint_value(cmd, activate_ARG, 0) == CHANGE_AAY) {
+ log_warn("lvmetad is active while using --sysinit -a ay, "
+ "skipping manual activation");
+ return ECMD_PROCESSED;
+ }
+
return process_each_lv(cmd, argc, argv,
update ? READ_FOR_UPDATE : 0, NULL,
&lvchange_single);
diff --git a/tools/vgchange.c b/tools/vgchange.c
index ebabb088..2013447b 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -608,6 +608,13 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if (arg_count(cmd, sysinit_ARG) && lvmetad_active() &&
+ arg_uint_value(cmd, activate_ARG, 0) == CHANGE_AAY) {
+ log_warn("lvmetad is active while using --sysinit -a ay, "
+ "skipping manual activation");
+ return ECMD_PROCESSED;
+ }
+
return process_each_vg(cmd, argc, argv, update ? READ_FOR_UPDATE : 0,
NULL, &vgchange_single);
}