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:
parent
045772aa30
commit
f1cad4c710
@ -1,5 +1,6 @@
|
||||
Version 2.02.166 -
|
||||
=====================================
|
||||
Use dm_config_parse_without_dup_node_check() to speedup metadata reading.
|
||||
Fix lvconvert --repair regression
|
||||
Fix reported origin lv field for cache volumes. (2.02.133)
|
||||
Always specify snapshot cow LV for monitoring not internal LV. (2.02.165)
|
||||
|
@ -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);
|
||||
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),
|
||||
outdated_pvs->root, NULL)))
|
||||
abort();
|
||||
|
@ -4431,7 +4431,7 @@ static void client_recv_action(struct client *cl)
|
||||
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) {
|
||||
log_error("client recv %u config_from_string error", cl->id);
|
||||
buffer_destroy(&req.buffer);
|
||||
|
2
lib/cache/lvmcache.c
vendored
2
lib/cache/lvmcache.c
vendored
@ -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 */
|
||||
if (!vginfo->cft &&
|
||||
!(vginfo->cft =
|
||||
dm_config_from_string(vginfo->vgmetadata)))
|
||||
config_tree_from_string_without_dup_node_check(vginfo->vgmetadata)))
|
||||
goto_bad;
|
||||
|
||||
if (!(vg = import_vg_from_config_tree(vginfo->cft, fid)))
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "text_export.h"
|
||||
#include "lvm-version.h"
|
||||
#include "toolcontext.h"
|
||||
#include "config-util.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
@ -1077,7 +1078,7 @@ struct dm_config_tree *export_vg_to_config_tree(struct volume_group *vg)
|
||||
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);
|
||||
dm_free(buf);
|
||||
return_NULL;
|
||||
|
@ -120,7 +120,7 @@ daemon_reply daemon_send(daemon_handle h, daemon_request rq)
|
||||
reply.error = errno;
|
||||
|
||||
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)
|
||||
reply.error = EPROTO;
|
||||
} else
|
||||
|
@ -444,7 +444,7 @@ static void *_client_thread(void *state)
|
||||
if (!buffer_read(ts->client.socket_fd, &req.buffer))
|
||||
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)
|
||||
fprintf(stderr, "error parsing request:\n %s\n", req.buffer.mem);
|
||||
|
Loading…
Reference in New Issue
Block a user