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

config: use config_tree_from_string_without_dup_node_check throughout code to construct metadata trees

This commit is contained in:
Peter Rajnoha 2016-09-21 14:59:14 +02:00 committed by Zdenek Kabelac
parent 045772aa30
commit f1cad4c710
7 changed files with 8 additions and 6 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.166 - Version 2.02.166 -
===================================== =====================================
Use dm_config_parse_without_dup_node_check() to speedup metadata reading.
Fix lvconvert --repair regression Fix lvconvert --repair regression
Fix reported origin lv field for cache volumes. (2.02.133) Fix reported origin lv field for cache volumes. (2.02.133)
Always specify snapshot cow LV for monitoring not internal LV. (2.02.165) Always specify snapshot cow LV for monitoring not internal LV. (2.02.165)

View File

@ -599,7 +599,7 @@ static void mark_outdated_pv(lvmetad_state *s, const char *vgid, const char *pvi
outdated_pvs = dm_hash_lookup(s->vgid_to_outdated_pvs, vgid); outdated_pvs = dm_hash_lookup(s->vgid_to_outdated_pvs, vgid);
if (!outdated_pvs) { if (!outdated_pvs) {
if (!(outdated_pvs = dm_config_from_string("outdated_pvs/pv_list = []")) || if (!(outdated_pvs = config_tree_from_string_without_dup_node_check("outdated_pvs/pv_list = []")) ||
!(cft_vgid = make_text_node(outdated_pvs, "vgid", dm_pool_strdup(outdated_pvs->mem, vgid), !(cft_vgid = make_text_node(outdated_pvs, "vgid", dm_pool_strdup(outdated_pvs->mem, vgid),
outdated_pvs->root, NULL))) outdated_pvs->root, NULL)))
abort(); abort();

View File

@ -4431,7 +4431,7 @@ static void client_recv_action(struct client *cl)
return; return;
} }
req.cft = dm_config_from_string(req.buffer.mem); req.cft = config_tree_from_string_without_dup_node_check(req.buffer.mem);
if (!req.cft) { if (!req.cft) {
log_error("client recv %u config_from_string error", cl->id); log_error("client recv %u config_from_string error", cl->id);
buffer_destroy(&req.buffer); buffer_destroy(&req.buffer);

View File

@ -1275,7 +1275,7 @@ struct volume_group *lvmcache_get_vg(struct cmd_context *cmd, const char *vgname
/* Build config tree from vgmetadata, if not yet cached */ /* Build config tree from vgmetadata, if not yet cached */
if (!vginfo->cft && if (!vginfo->cft &&
!(vginfo->cft = !(vginfo->cft =
dm_config_from_string(vginfo->vgmetadata))) config_tree_from_string_without_dup_node_check(vginfo->vgmetadata)))
goto_bad; goto_bad;
if (!(vg = import_vg_from_config_tree(vginfo->cft, fid))) if (!(vg = import_vg_from_config_tree(vginfo->cft, fid)))

View File

@ -22,6 +22,7 @@
#include "text_export.h" #include "text_export.h"
#include "lvm-version.h" #include "lvm-version.h"
#include "toolcontext.h" #include "toolcontext.h"
#include "config-util.h"
#include <stdarg.h> #include <stdarg.h>
#include <time.h> #include <time.h>
@ -1077,7 +1078,7 @@ struct dm_config_tree *export_vg_to_config_tree(struct volume_group *vg)
return_NULL; return_NULL;
} }
if (!(vg_cft = dm_config_from_string(buf))) { if (!(vg_cft = config_tree_from_string_without_dup_node_check(buf))) {
log_error("Error parsing metadata for VG %s.", vg->name); log_error("Error parsing metadata for VG %s.", vg->name);
dm_free(buf); dm_free(buf);
return_NULL; return_NULL;

View File

@ -120,7 +120,7 @@ daemon_reply daemon_send(daemon_handle h, daemon_request rq)
reply.error = errno; reply.error = errno;
if (buffer_read(h.socket_fd, &reply.buffer)) { if (buffer_read(h.socket_fd, &reply.buffer)) {
reply.cft = dm_config_from_string(reply.buffer.mem); reply.cft = config_tree_from_string_without_dup_node_check(reply.buffer.mem);
if (!reply.cft) if (!reply.cft)
reply.error = EPROTO; reply.error = EPROTO;
} else } else

View File

@ -444,7 +444,7 @@ static void *_client_thread(void *state)
if (!buffer_read(ts->client.socket_fd, &req.buffer)) if (!buffer_read(ts->client.socket_fd, &req.buffer))
goto fail; goto fail;
req.cft = dm_config_from_string(req.buffer.mem); req.cft = config_tree_from_string_without_dup_node_check(req.buffer.mem);
if (!req.cft) if (!req.cft)
fprintf(stderr, "error parsing request:\n %s\n", req.buffer.mem); fprintf(stderr, "error parsing request:\n %s\n", req.buffer.mem);