summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2012-06-28 04:15:07 -0400
committerPeter Rajnoha <prajnoha@redhat.com>2012-06-28 09:44:07 -0400
commita2f4ccd83907590d16e6d06e1aea7e70efcf1fe5 (patch)
tree813d18e82fe314ca85075ea786bf393302bd6473 /tools
parentc9b9077b44119db0bfd926730cb79ebf0990c980 (diff)
downloadlvm2-a2f4ccd83907590d16e6d06e1aea7e70efcf1fe5.tar.gz
lvm2-a2f4ccd83907590d16e6d06e1aea7e70efcf1fe5.tar.xz
lvm2-a2f4ccd83907590d16e6d06e1aea7e70efcf1fe5.zip
lvcreate: add --activate ay (autoactivate)
One can use "lvcreate --aay" to have the newly created volume activated or not activated based on the activation/auto_activation_volume_list this way. Note: -Z/--zero is not compatible with -aay, zeroing is not used in this case! When using lvcreate -aay, a default warning message is also issued that zeroing is not done.
Diffstat (limited to 'tools')
-rw-r--r--tools/commands.h2
-rw-r--r--tools/lvcreate.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/tools/commands.h b/tools/commands.h
index b863c66c..3454951a 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -159,7 +159,7 @@ xx(lvcreate,
0,
"lvcreate " "\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/lvcreate.c b/tools/lvcreate.c
index a81e39d3..ab217cfb 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -567,6 +567,12 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
log_error("--activate n requires --zero n");
return 0;
}
+ } else if (lp->activate == CHANGE_AAY) {
+ if (arg_count(cmd, zero_ARG)) {
+ log_error("-Z is incompatible with --activate a");
+ return 0;
+ }
+ lp->zero = 0;
}
/*