1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cmdline: lvcreate adds vdopool as vg name provider

Add same logic as with thinpool or cachepool.
This commit is contained in:
Zdenek Kabelac 2021-02-25 17:41:39 +01:00
parent f87d1a2abb
commit e946a5e690

View File

@ -1519,7 +1519,7 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
* the VG position is allowed to be empty if --name VG/LV is used, or if the
* LVM_VG_NAME env var is set.
*
* --thinpool VG/LV and --cachepool VG/LV can also function like --name
* --thinpool|--cachepool|--vdopool VG/LV can also function like --name
* to provide the VG name in place of the positional arg.
*/
if (!strcmp(cmd->name, "lvcreate") &&
@ -1528,6 +1528,7 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
(arg_is_set(cmd, name_ARG) ||
arg_is_set(cmd, thinpool_ARG) ||
arg_is_set(cmd, cachepool_ARG) ||
arg_is_set(cmd, vdopool_ARG) ||
getenv("LVM_VG_NAME"))) {
if (getenv("LVM_VG_NAME"))
@ -1547,6 +1548,9 @@ static int _command_required_pos_matches(struct cmd_context *cmd, int ci, int rp
if (strstr(name, "/"))
return 1;
}
if ((name = arg_str_value(cmd, vdopool_ARG, NULL)) && strstr(name, "/"))
return 1;
}
return 0;