public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW_DM libdm/libdm-config.c
@ 2012-05-08 14:31 agk
0 siblings, 0 replies; 2+ messages in thread
From: agk @ 2012-05-08 14:31 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk@sourceware.org 2012-05-08 14:31:46
Modified files:
. : WHATS_NEW_DM
libdm : libdm-config.c
Log message:
Log value chosen in _find_config_bool like other variable types do.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.600&r2=1.601
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-config.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
--- LVM2/WHATS_NEW_DM 2012/04/24 12:25:12 1.600
+++ LVM2/WHATS_NEW_DM 2012/05/08 14:31:44 1.601
@@ -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.
--- LVM2/libdm/libdm-config.c 2012/03/01 19:54:53 1.23
+++ LVM2/libdm/libdm-config.c 2012/05/08 14:31:45 1.24
@@ -842,22 +842,29 @@
{
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:
- return v->v.i ? 1 : 0;
-
- case DM_CFG_STRING:
- return _str_to_bool(v->v.str, fail);
- default:
- ;
+ switch (v->type) {
+ case DM_CFG_INT:
+ b = v->v.i ? 1 : 0;
+ log_very_verbose("Setting %s to %d", path, b);
+ return b;
+
+ 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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* LVM2 ./WHATS_NEW_DM libdm/libdm-config.c
@ 2011-09-25 19:39 zkabelac
0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2011-09-25 19:39 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2011-09-25 19:38:59
Modified files:
. : WHATS_NEW_DM
libdm : libdm-config.c
Log message:
Use NULL for pointers
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW_DM.diff?cvsroot=lvm2&r1=1.506&r2=1.507
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-config.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7
--- LVM2/WHATS_NEW_DM 2011/09/23 09:51:37 1.506
+++ LVM2/WHATS_NEW_DM 2011/09/25 19:38:59 1.507
@@ -1,5 +1,6 @@
Version 1.02.68 -
==================================
+ Improve libdm-config error path reporting.
Update dmsetup resume man with --addnodeonresume/create options.
Add dependency for dm man pages to man subdirectory make target all:.
Add dm_tree_retry_remove to use retry logic for device removal in a dm_tree.
--- LVM2/libdm/libdm-config.c 2011/09/02 01:32:09 1.6
+++ LVM2/libdm/libdm-config.c 2011/09/25 19:38:59 1.7
@@ -523,7 +523,7 @@
struct dm_config_node *root = NULL, *n, *l = NULL;
while (p->t != TOK_EOF) {
if (!(n = _section(p)))
- return_0;
+ return_NULL;
if (!root)
root = n;
@@ -540,10 +540,10 @@
/* IDENTIFIER SECTION_B_CHAR VALUE* SECTION_E_CHAR */
struct dm_config_node *root, *n, *l = NULL;
if (!(root = _create_node(p->mem)))
- return_0;
+ return_NULL;
if (!(root->key = _dup_tok(p)))
- return_0;
+ return_NULL;
match(TOK_IDENTIFIER);
@@ -551,7 +551,7 @@
match(TOK_SECTION_B);
while (p->t != TOK_SECTION_E) {
if (!(n = _section(p)))
- return_0;
+ return_NULL;
if (!root->child)
root->child = n;
@@ -564,7 +564,7 @@
} else {
match(TOK_EQ);
if (!(root->v = _value(p)))
- return_0;
+ return_NULL;
}
return root;
@@ -578,7 +578,7 @@
match(TOK_ARRAY_B);
while (p->t != TOK_ARRAY_E) {
if (!(l = _type(p)))
- return_0;
+ return_NULL;
if (!h)
h = l;
@@ -595,7 +595,7 @@
*/
if (!h) {
if (!(h = _create_value(p->mem)))
- return NULL;
+ return_NULL;
h->type = DM_CFG_EMPTY_ARRAY;
}
@@ -633,7 +633,7 @@
p->tb++, p->te--; /* strip "'s */
if (!(v->v.str = _dup_tok(p)))
- return_0;
+ return_NULL;
p->te++;
match(TOK_STRING);
break;
@@ -643,7 +643,7 @@
p->tb++, p->te--; /* strip "'s */
if (!(str = _dup_tok(p)))
- return_0;
+ return_NULL;
dm_unescape_double_quotes(str);
v->v.str = str;
p->te++;
@@ -653,7 +653,7 @@
default:
log_error("Parse error at byte %" PRIptrdiff_t " (line %d): expected a value",
p->tb - p->fb + 1, p->line);
- return 0;
+ return NULL;
}
return v;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-08 14:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-08 14:31 LVM2 ./WHATS_NEW_DM libdm/libdm-config.c agk
-- strict thread matches above, loose matches on Subject: below --
2011-09-25 19:39 zkabelac
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).