summaryrefslogtreecommitdiffstats
path: root/lib/common/ipc_schedulerd.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/ipc_schedulerd.c')
-rw-r--r--lib/common/ipc_schedulerd.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/common/ipc_schedulerd.c b/lib/common/ipc_schedulerd.c
index cf788e5..45c5803 100644
--- a/lib/common/ipc_schedulerd.c
+++ b/lib/common/ipc_schedulerd.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2021-2023 the Pacemaker project contributors
+ * Copyright 2021-2024 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -13,7 +13,6 @@
#include <time.h>
#include <crm/crm.h>
-#include <crm/msg_xml.h>
#include <crm/common/xml.h>
#include <crm/common/ipc.h>
#include <crm/common/ipc_internal.h>
@@ -64,7 +63,7 @@ post_connect(pcmk_ipc_api_t *api)
static bool
reply_expected(pcmk_ipc_api_t *api, const xmlNode *request)
{
- const char *command = crm_element_value(request, F_CRM_TASK);
+ const char *command = crm_element_value(request, PCMK__XA_CRM_TASK);
if (command == NULL) {
return false;
@@ -78,39 +77,44 @@ static bool
dispatch(pcmk_ipc_api_t *api, xmlNode *reply)
{
crm_exit_t status = CRM_EX_OK;
+ xmlNode *wrapper = NULL;
xmlNode *msg_data = NULL;
pcmk_schedulerd_api_reply_t reply_data = {
pcmk_schedulerd_reply_unknown
};
const char *value = NULL;
- if (pcmk__str_eq((const char *) reply->name, "ack", pcmk__str_casei)) {
+ if (pcmk__xe_is(reply, PCMK__XE_ACK)) {
return false;
}
- value = crm_element_value(reply, F_CRM_MSG_TYPE);
- if (!pcmk__str_eq(value, XML_ATTR_RESPONSE, pcmk__str_none)) {
+ value = crm_element_value(reply, PCMK__XA_SUBT);
+ if (!pcmk__str_eq(value, PCMK__VALUE_RESPONSE, pcmk__str_none)) {
crm_info("Unrecognizable message from schedulerd: "
- "message type '%s' not '" XML_ATTR_RESPONSE "'",
+ "message type '%s' not '" PCMK__VALUE_RESPONSE "'",
pcmk__s(value, ""));
status = CRM_EX_PROTOCOL;
goto done;
}
- if (pcmk__str_empty(crm_element_value(reply, XML_ATTR_REFERENCE))) {
+ if (pcmk__str_empty(crm_element_value(reply, PCMK_XA_REFERENCE))) {
crm_info("Unrecognizable message from schedulerd: no reference");
status = CRM_EX_PROTOCOL;
goto done;
}
// Parse useful info from reply
- msg_data = get_message_xml(reply, F_CRM_DATA);
- value = crm_element_value(reply, F_CRM_TASK);
+ wrapper = pcmk__xe_first_child(reply, PCMK__XE_CRM_XML, NULL, NULL);
+ msg_data = pcmk__xe_first_child(wrapper, NULL, NULL, NULL);
+
+ value = crm_element_value(reply, PCMK__XA_CRM_TASK);
if (pcmk__str_eq(value, CRM_OP_PECALC, pcmk__str_none)) {
reply_data.reply_type = pcmk_schedulerd_reply_graph;
- reply_data.data.graph.reference = crm_element_value(reply, XML_ATTR_REFERENCE);
- reply_data.data.graph.input = crm_element_value(reply, F_CRM_TGRAPH_INPUT);
+ reply_data.data.graph.reference = crm_element_value(reply,
+ PCMK_XA_REFERENCE);
+ reply_data.data.graph.input = crm_element_value(reply,
+ PCMK__XA_CRM_TGRAPH_IN);
reply_data.data.graph.tgraph = msg_data;
} else {
crm_info("Unrecognizable message from schedulerd: "
@@ -164,7 +168,7 @@ do_schedulerd_api_call(pcmk_ipc_api_t *api, const char *task, xmlNode *cib, char
pcmk_rc_str(rc), rc);
}
- *ref = strdup(crm_element_value(cmd, F_CRM_REFERENCE));
+ *ref = strdup(crm_element_value(cmd, PCMK_XA_REFERENCE));
free_xml(cmd);
} else {
rc = ENOMSG;