|
1 | 1 | /* |
2 | | - * Copyright 2004-2025 the Pacemaker project contributors |
| 2 | + * Copyright 2004-2026 the Pacemaker project contributors |
3 | 3 | * |
4 | 4 | * The version control history for this file may have further details. |
5 | 5 | * |
|
9 | 9 |
|
10 | 10 | #include <crm_internal.h> |
11 | 11 |
|
12 | | -#include <sys/param.h> |
13 | | -#include <stdio.h> |
14 | | -#include <sys/types.h> |
15 | | -#include <unistd.h> |
16 | | - |
| 12 | +#include <errno.h> // EACCES, ECONNREFUSED |
| 13 | +#include <inttypes.h> // PRIu64 |
17 | 14 | #include <stdbool.h> |
18 | | -#include <stdlib.h> |
19 | | -#include <stdint.h> // uint32_t, uint64_t, UINT64_C() |
20 | | -#include <errno.h> |
21 | | -#include <fcntl.h> |
22 | | -#include <inttypes.h> // PRIu64 |
23 | | - |
24 | | -#include <glib.h> |
25 | | -#include <libxml/tree.h> |
26 | | -#include <libxml/xpath.h> // xmlXPathObject, etc. |
27 | | - |
28 | | -#include <crm/crm.h> |
29 | | -#include <crm/cib.h> |
30 | | -#include <crm/cluster/internal.h> |
31 | | - |
32 | | -#include <crm/common/xml.h> |
33 | | - |
34 | | -#include <pacemaker-based.h> |
| 15 | +#include <stddef.h> // NULL, size_t |
| 16 | +#include <stdint.h> // u?int*_t, UINT64_C |
| 17 | +#include <stdio.h> // snprintf |
| 18 | +#include <stdlib.h> // free |
| 19 | +#include <sys/types.h> // gid_t, uid_t |
| 20 | +#include <syslog.h> // LOG_INFO, LOG_DEBUG |
| 21 | +#include <time.h> // time_t |
| 22 | +#include <unistd.h> // close |
| 23 | + |
| 24 | +#include <glib.h> // gboolean, gpointer, g_*, etc. |
| 25 | +#include <libxml/tree.h> // xmlNode |
| 26 | +#include <libxml/xpath.h> // xmlXPath* |
| 27 | +#include <qb/qbdefs.h> // QB_FALSE |
| 28 | +#include <qb/qbipcs.h> // qb_ipcs_connection_t |
| 29 | +#include <qb/qblog.h> // LOG_TRACE |
| 30 | + |
| 31 | +#include <crm/cib.h> // cib_call_options values |
| 32 | +#include <crm/cib/internal.h> // cib__* |
| 33 | +#include <crm/cluster.h> // pcmk_cluster_disconnect |
| 34 | +#include <crm/cluster/internal.h> // pcmk__cluster_send_message |
| 35 | +#include <crm/common/cib.h> // pcmk_find_cib_element |
| 36 | +#include <crm/common/internal.h> // pcmk__s, pcmk__str_eq |
| 37 | +#include <crm/common/ipc.h> // crm_ipc_*, pcmk_ipc_* |
| 38 | +#include <crm/common/logging.h> // CRM_LOG_ASSERT, CRM_CHECK |
| 39 | +#include <crm/common/mainloop.h> // mainloop_* |
| 40 | +#include <crm/common/results.h> // pcmk_rc_* |
| 41 | +#include <crm/common/xml.h> // PCMK_XA_*, PCMK_XE_* |
| 42 | +#include <crm/crm.h> // CRM_OP_* |
| 43 | + |
| 44 | +#include "pacemaker-based.h" |
35 | 45 |
|
36 | 46 | #define EXIT_ESCALATION_MS 10000 |
37 | 47 |
|
@@ -1127,8 +1137,7 @@ cib_process_command(xmlNode *request, const cib__operation_t *operation, |
1127 | 1137 | pcmk__xe_get(result_cib, PCMK_XA_NUM_UPDATES), |
1128 | 1138 | (config_changed? " changed" : "")); |
1129 | 1139 |
|
1130 | | - rc = activateCibXml(result_cib, config_changed, op); |
1131 | | - rc = pcmk_legacy2rc(rc); |
| 1140 | + rc = based_activate_cib(result_cib, config_changed, op); |
1132 | 1141 | if (rc != pcmk_rc_ok) { |
1133 | 1142 | pcmk__err("Failed to activate new CIB: %s", pcmk_rc_str(rc)); |
1134 | 1143 | } |
@@ -1183,8 +1192,8 @@ cib_process_command(xmlNode *request, const cib__operation_t *operation, |
1183 | 1192 | cib_dryrun|cib_inhibit_notify|cib_transaction)) { |
1184 | 1193 | pcmk__trace("Sending notifications %d", |
1185 | 1194 | pcmk__is_set(call_options, cib_dryrun)); |
1186 | | - cib_diff_notify(op, pcmk_rc2legacy(rc), call_id, client_id, client_name, |
1187 | | - originator, input, cib_diff); |
| 1195 | + based_diff_notify(op, pcmk_rc2legacy(rc), call_id, client_id, |
| 1196 | + client_name, originator, input, cib_diff); |
1188 | 1197 | } |
1189 | 1198 |
|
1190 | 1199 | pcmk__log_xml_patchset(LOG_TRACE, cib_diff); |
@@ -1363,7 +1372,7 @@ terminate_cib(int exit_status) |
1363 | 1372 | remote_tls_fd = 0; |
1364 | 1373 | } |
1365 | 1374 |
|
1366 | | - uninitializeCib(); |
| 1375 | + g_clear_pointer(&the_cib, pcmk__xml_free); |
1367 | 1376 |
|
1368 | 1377 | // Exit immediately on error |
1369 | 1378 | if (exit_status > CRM_EX_OK) { |
|
0 commit comments