From 704b42f153f060af814ae83e1193d383f14088c4 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Thu, 24 Oct 2024 12:29:33 -0500
Subject: [PATCH 03/16] Low: pacemaker-attrd: use API to get peer XML ID

... for cleaner separation, and to ensure it is set whenever possible.
---
 daemons/attrd/attrd_cib.c      | 2 +-
 daemons/attrd/attrd_corosync.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/daemons/attrd/attrd_cib.c b/daemons/attrd/attrd_cib.c
index b8f509ab7d..6129f54c75 100644
--- a/daemons/attrd/attrd_cib.c
+++ b/daemons/attrd/attrd_cib.c
@@ -558,7 +558,7 @@ write_attribute(attribute_t *a, bool ignore_delay)
                                                        NULL,
                                                        pcmk__node_search_any);
 
-            node_xml_id = peer->xml_id;
+            node_xml_id = pcmk__cluster_node_uuid(peer);
 
             // Remember peer's node ID if we're just now learning it
             if ((peer->cluster_layer_id != 0) && (v->nodeid == 0)) {
diff --git a/daemons/attrd/attrd_corosync.c b/daemons/attrd/attrd_corosync.c
index eeb2b9b1df..72ebc1843b 100644
--- a/daemons/attrd/attrd_corosync.c
+++ b/daemons/attrd/attrd_corosync.c
@@ -215,8 +215,8 @@ record_peer_nodeid(attribute_value_t *v, const char *host)
     pcmk__node_status_t *known_peer =
         pcmk__get_node(v->nodeid, host, NULL, pcmk__node_search_cluster_member);
 
-    crm_trace("Learned %s has node id %s",
-              known_peer->name, known_peer->xml_id);
+    crm_trace("Learned %s has XML ID %s",
+              known_peer->name, pcmk__cluster_node_uuid(known_peer));
     if (attrd_election_won()) {
         attrd_write_attributes(attrd_write_changed);
     }
-- 
2.43.0

