mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
lvcreate: improving recent lvcreate updates
We need to be able to parse: lvcreate --type snapshot -s lvcreate --type thin -s lvcreate --type cache-pool -H
This commit is contained in:
parent
651613e9a4
commit
87fc3b710c
@ -153,6 +153,8 @@ static int _lvcreate_name_params(struct cmd_context *cmd,
|
|||||||
|
|
||||||
vg_name = skip_dev_dir(cmd, argv[0], NULL);
|
vg_name = skip_dev_dir(cmd, argv[0], NULL);
|
||||||
if (!strchr(vg_name, '/')) {
|
if (!strchr(vg_name, '/')) {
|
||||||
|
if (lp->snapshot && arg_is_set(cmd, virtualsize_ARG))
|
||||||
|
lp->snapshot = 0 ; /* Sparse volume via thin-pool */
|
||||||
if (!_set_vg_name(lp, vg_name))
|
if (!_set_vg_name(lp, vg_name))
|
||||||
return_0;
|
return_0;
|
||||||
} else {
|
} else {
|
||||||
@ -639,10 +641,6 @@ static int _lvcreate_params(struct cmd_context *cmd,
|
|||||||
segtype_str = "striped";
|
segtype_str = "striped";
|
||||||
only_linear = 1; /* User requested linear only target */
|
only_linear = 1; /* User requested linear only target */
|
||||||
}
|
}
|
||||||
if (arg_from_list_is_set(cmd, "is conflicting with option --type",
|
|
||||||
cache_ARG, thin_ARG, snapshot_ARG,
|
|
||||||
-1))
|
|
||||||
return_0;
|
|
||||||
/* More estimations from options after shortcuts */
|
/* More estimations from options after shortcuts */
|
||||||
} else if (arg_is_set(cmd, snapshot_ARG) &&
|
} else if (arg_is_set(cmd, snapshot_ARG) &&
|
||||||
(arg_is_set(cmd, virtualoriginsize_ARG) ||
|
(arg_is_set(cmd, virtualoriginsize_ARG) ||
|
||||||
@ -754,6 +752,7 @@ static int _lvcreate_params(struct cmd_context *cmd,
|
|||||||
LVCREATE_ARGS,
|
LVCREATE_ARGS,
|
||||||
POOL_ARGS,
|
POOL_ARGS,
|
||||||
SIZE_ARGS,
|
SIZE_ARGS,
|
||||||
|
cache_ARG,
|
||||||
chunksize_ARG,
|
chunksize_ARG,
|
||||||
-1))
|
-1))
|
||||||
return_0;
|
return_0;
|
||||||
@ -853,6 +852,7 @@ static int _lvcreate_params(struct cmd_context *cmd,
|
|||||||
SIZE_ARGS,
|
SIZE_ARGS,
|
||||||
THIN_POOL_ARGS,
|
THIN_POOL_ARGS,
|
||||||
chunksize_ARG,
|
chunksize_ARG,
|
||||||
|
snapshot_ARG,
|
||||||
thin_ARG,
|
thin_ARG,
|
||||||
virtualsize_ARG,
|
virtualsize_ARG,
|
||||||
wipesignatures_ARG, zero_ARG,
|
wipesignatures_ARG, zero_ARG,
|
||||||
@ -888,7 +888,8 @@ static int _lvcreate_params(struct cmd_context *cmd,
|
|||||||
return_0;
|
return_0;
|
||||||
} else /* Parse free arg as snapshot origin */
|
} else /* Parse free arg as snapshot origin */
|
||||||
lp->snapshot = 1;
|
lp->snapshot = 1;
|
||||||
}
|
} else if (arg_is_set(cmd, snapshot_ARG))
|
||||||
|
lp->snapshot = 1;
|
||||||
} else if (seg_is_thin_pool(lp)) {
|
} else if (seg_is_thin_pool(lp)) {
|
||||||
if (arg_outside_list_is_set(cmd, "is unsupported with thin pools",
|
if (arg_outside_list_is_set(cmd, "is unsupported with thin pools",
|
||||||
LVCREATE_ARGS,
|
LVCREATE_ARGS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user