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

config: make a difference between "not found" and "is empty" in log msg for devices/preferred_names

Replace misleading "not found" in the log message when
devices/preferred_names is set to empty array:

Really not found:
device/dev-cache.c:689   devices/preferred_names not found in config: using built-in preferences

Found, but empty:
config/config.c:1431   Setting devices/preferred_names to preferred_names = [ ]
device/dev-cache.c:689   devices/preferred_names is empty: using built-in preferences
This commit is contained in:
Peter Rajnoha 2015-07-15 16:14:07 +02:00
parent d10fb73f63
commit d947a815e8

View File

@ -683,8 +683,10 @@ static int _init_preferred_names(struct cmd_context *cmd)
if (!(cn = find_config_tree_array(cmd, devices_preferred_names_CFG, NULL)) || if (!(cn = find_config_tree_array(cmd, devices_preferred_names_CFG, NULL)) ||
cn->v->type == DM_CFG_EMPTY_ARRAY) { cn->v->type == DM_CFG_EMPTY_ARRAY) {
log_very_verbose("devices/preferred_names not found in config file: " log_very_verbose("devices/preferred_names %s: "
"using built-in preferences"); "using built-in preferences",
cn && cn->v->type == DM_CFG_EMPTY_ARRAY ? "is empty"
: "not found in config");
return 1; return 1;
} }