diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2016-09-21 14:42:16 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-09-21 18:18:15 +0200 |
commit | 045772aa30ba1c5ab9dff730ce25ca6346c7150a (patch) | |
tree | f65a82722edd7057e08579658490b87f1b20fd51 /libdaemon | |
parent | e40fbd08c8e3da43d07aabe58bd5549105056908 (diff) | |
download | lvm2-045772aa30ba1c5ab9dff730ce25ca6346c7150a.tar.gz |
config: add config_tree_from_string_without_dup_node_check to replace dm_config_from_string where needed
Diffstat (limited to 'libdaemon')
-rw-r--r-- | libdaemon/client/config-util.c | 15 | ||||
-rw-r--r-- | libdaemon/client/config-util.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libdaemon/client/config-util.c b/libdaemon/client/config-util.c index e262182b6..93f3d0a93 100644 --- a/libdaemon/client/config-util.c +++ b/libdaemon/client/config-util.c @@ -161,6 +161,21 @@ void chain_node(struct dm_config_node *cn, } +struct dm_config_tree *config_tree_from_string_without_dup_node_check(const char *config_settings) +{ + struct dm_config_tree *cft; + + if (!(cft = dm_config_create())) + return_NULL; + + if (!dm_config_parse_without_dup_node_check(cft, config_settings, config_settings + strlen(config_settings))) { + dm_config_destroy(cft); + return_NULL; + } + + return cft; +} + struct dm_config_node *make_config_node(struct dm_config_tree *cft, const char *key, struct dm_config_node *parent, diff --git a/libdaemon/client/config-util.h b/libdaemon/client/config-util.h index 38f36af31..485161f7b 100644 --- a/libdaemon/client/config-util.h +++ b/libdaemon/client/config-util.h @@ -66,4 +66,6 @@ struct dm_config_node *config_make_nodes(struct dm_config_tree *cft, struct dm_config_node *pre_sib, ...); +struct dm_config_tree *config_tree_from_string_without_dup_node_check(const char *config_settings); + #endif /* _LVM_DAEMON_CONFIG_UTIL_H */ |