diff options
author | Alasdair Kergon <agk@redhat.com> | 2012-05-08 14:31:44 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2012-05-08 14:31:44 +0000 |
commit | a93ad77e029da72534bac96ff2854755eb65c074 (patch) | |
tree | 82fc831a5147ab82f8b7969715fb0c664595456a | |
parent | 679f946dd991d4116d63e60e68f212312447e5aa (diff) | |
download | lvm2-a93ad77e029da72534bac96ff2854755eb65c074.tar.gz |
Log value chosen in _find_config_bool like other variable types do.
-rw-r--r-- | WHATS_NEW_DM | 1 | ||||
-rw-r--r-- | libdm/libdm-config.c | 29 |
2 files changed, 19 insertions, 11 deletions
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 28fd06d0e..6800b5a82 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.75 - ================================ + Log value chosen in _find_config_bool like other variable types do. Synchronize with dead of dmeventd. Rename (Blk)DevNames/DevNos dmsetup header to (Blk)DevNamesUsed/DevNosUsed. Add configure --with-veritysetup for independent veritysetup tool. diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c index 8683b5a57..d9d3882f2 100644 --- a/libdm/libdm-config.c +++ b/libdm/libdm-config.c @@ -842,22 +842,29 @@ static int _find_config_bool(const void *start, node_lookup_fn find, { const struct dm_config_node *n = find(start, path); const struct dm_config_value *v; + int b; - if (!n) - return fail; + if (n) { + v = n->v; - v = n->v; + switch (v->type) { + case DM_CFG_INT: + b = v->v.i ? 1 : 0; + log_very_verbose("Setting %s to %d", path, b); + return b; - switch (v->type) { - case DM_CFG_INT: - return v->v.i ? 1 : 0; - - case DM_CFG_STRING: - return _str_to_bool(v->v.str, fail); - default: - ; + case DM_CFG_STRING: + b = _str_to_bool(v->v.str, fail); + log_very_verbose("Setting %s to %d", path, b); + return b; + default: + ; + } } + log_very_verbose("%s not found in config: defaulting to %d", + path, fail); + return fail; } |