File pacemaker#3772-0001-Refactor-libpacemaker-add-PCMK__XA_FAILED_START_OFFS.patch of Package pacemaker.38493

From 96381eabe9b2b01cdcf49dc2d3b3e6de79131747 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 13 Dec 2024 10:47:11 +0100
Subject: [PATCH 1/2] Refactor: libpacemaker: add PCMK__XA_FAILED_START_OFFSET
 and PCMK__XA_FAILED_STOP_OFFSET

Besides, use CRM_INFINITY_S constant instead of "INFINITY".
---
 include/crm_internal.h | 2 ++
 lib/pacemaker/pcmk_graph_consumer.c     | 4 ++--
 lib/pacemaker/pcmk_graph_producer.c     | 8 +++++---
 3 files changed, 9 insertions(+), 5 deletions(-)

Index: pacemaker-2.1.5+20221208.a3f44794f/include/crm_internal.h
===================================================================
--- pacemaker-2.1.5+20221208.a3f44794f.orig/include/crm_internal.h
+++ pacemaker-2.1.5+20221208.a3f44794f/include/crm_internal.h
@@ -78,6 +78,8 @@
 #define PCMK__XA_ATTR_WRITER            "attr_writer"
 #define PCMK__XA_CONFIG_ERRORS          "config-errors"
 #define PCMK__XA_CONFIG_WARNINGS        "config-warnings"
+#define PCMK__XA_FAILED_START_OFFSET    "failed-start-offset"
+#define PCMK__XA_FAILED_STOP_OFFSET     "failed-stop-offset"
 #define PCMK__XA_GRAPH_ERRORS           "graph-errors"
 #define PCMK__XA_GRAPH_WARNINGS         "graph-warnings"
 #define PCMK__XA_MODE                   "mode"
Index: pacemaker-2.1.5+20221208.a3f44794f/lib/pacemaker/pcmk_graph_producer.c
===================================================================
--- pacemaker-2.1.5+20221208.a3f44794f.orig/lib/pacemaker/pcmk_graph_producer.c
+++ pacemaker-2.1.5+20221208.a3f44794f/lib/pacemaker/pcmk_graph_producer.c
@@ -1002,12 +1002,14 @@ pcmk__create_graph(pe_working_set_t *dat
     value = pe_pref(data_set->config_hash, "stonith-timeout");
     crm_xml_add(data_set->graph, "stonith-timeout", value);
 
-    crm_xml_add(data_set->graph, "failed-stop-offset", "INFINITY");
+    crm_xml_add(data_set->graph, PCMK__XA_FAILED_STOP_OFFSET,
+                CRM_INFINITY_S);
 
     if (pcmk_is_set(data_set->flags, pe_flag_start_failure_fatal)) {
-        crm_xml_add(data_set->graph, "failed-start-offset", "INFINITY");
+        crm_xml_add(data_set->graph, PCMK__XA_FAILED_START_OFFSET,
+                    CRM_INFINITY_S);
     } else {
-        crm_xml_add(data_set->graph, "failed-start-offset", "1");
+        crm_xml_add(data_set->graph, PCMK__XA_FAILED_START_OFFSET, "1");
     }
 
     value = pe_pref(data_set->config_hash, "batch-limit");
openSUSE Build Service is sponsored by