1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

better -m0 error message, but there's an internal logic error to fix instead

This commit is contained in:
Alasdair Kergon 2011-09-27 12:37:07 +00:00
parent d71fd30e5d
commit 0ed2af7fb1

View File

@ -575,11 +575,14 @@ static int _lvcreate_params(struct lvcreate_params *lp,
/*
* Check selected options are compatible and determine segtype
*/
// FIXME -m0 implies *striped*
if (arg_count(cmd, thin_ARG) && arg_count(cmd,mirrors_ARG)) {
log_error("--thin and --mirrors are incompatible.");
return 0;
}
// FIXME -m0 implies *striped*
/* Set default segtype */
if (arg_count(cmd, mirrors_ARG))
segtype_str = find_config_tree_str(cmd, "global/mirror_segtype_default", DEFAULT_MIRROR_SEGTYPE);
@ -620,7 +623,7 @@ static int _lvcreate_params(struct lvcreate_params *lp,
lp->mirrors = arg_uint_value(cmd, mirrors_ARG, 0) + 1;
if (lp->mirrors == 1) {
if (segtype_is_mirrored(lp->segtype)) {
log_error("Image count for segtype \"%s\" cannot be 0.", lp->segtype->name);
log_error("--mirrors must be at least 1 with segment type %s.", lp->segtype->name);
return 0;
}
log_print("Redundant mirrors argument: default is 0");