mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +03:00
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.
This commit is contained in:
parent
c9b9077b44
commit
a2f4ccd839
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.97 -
|
Version 2.02.97 -
|
||||||
===============================
|
===============================
|
||||||
|
Add --activate ay to lvcreate.
|
||||||
Add --activate ay to lvchange.
|
Add --activate ay to lvchange.
|
||||||
Add --activate ay to pvscan.
|
Add --activate ay to pvscan.
|
||||||
Add --activate ay to vgchange.
|
Add --activate ay to vgchange.
|
||||||
|
@ -4433,6 +4433,15 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
|
|||||||
|
|
||||||
backup(vg);
|
backup(vg);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check for autoactivation.
|
||||||
|
* If the LV passes the auto activation filter, activate
|
||||||
|
* it just as if CHANGE_AY was used, CHANGE_AN otherwise.
|
||||||
|
*/
|
||||||
|
if (lp->activate == CHANGE_AAY)
|
||||||
|
lp->activate = lv_passes_auto_activation_filter(cmd, lv) ?
|
||||||
|
CHANGE_ALY : CHANGE_ALN;
|
||||||
|
|
||||||
if (test_mode()) {
|
if (test_mode()) {
|
||||||
log_verbose("Test mode: Skipping activation and zeroing.");
|
log_verbose("Test mode: Skipping activation and zeroing.");
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -159,7 +159,7 @@ xx(lvcreate,
|
|||||||
0,
|
0,
|
||||||
"lvcreate " "\n"
|
"lvcreate " "\n"
|
||||||
"\t[-A|--autobackup {y|n}]\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[--addtag Tag]\n"
|
||||||
"\t[--alloc AllocationPolicy]\n"
|
"\t[--alloc AllocationPolicy]\n"
|
||||||
"\t[-C|--contiguous {y|n}]\n"
|
"\t[-C|--contiguous {y|n}]\n"
|
||||||
|
@ -567,6 +567,12 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex
|
|||||||
log_error("--activate n requires --zero n");
|
log_error("--activate n requires --zero n");
|
||||||
return 0;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user