diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
commit | 7332b914bff2786ff70ccace103fc9ebdfb61a23 (patch) | |
tree | 3a8a60c4edba014c7e350be41839e3edbf2a315f /daemons/controld/controld_transition.c | |
parent | Adding debian version 2.1.7-1. (diff) | |
download | pacemaker-7332b914bff2786ff70ccace103fc9ebdfb61a23.tar.xz pacemaker-7332b914bff2786ff70ccace103fc9ebdfb61a23.zip |
Merging upstream version 2.1.8~rc1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemons/controld/controld_transition.c')
-rw-r--r-- | daemons/controld/controld_transition.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/daemons/controld/controld_transition.c b/daemons/controld/controld_transition.c index 897c6d3..184253d 100644 --- a/daemons/controld/controld_transition.c +++ b/daemons/controld/controld_transition.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2023 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -10,7 +10,6 @@ #include <crm_internal.h> #include <crm/crm.h> -#include <crm/msg_xml.h> #include <crm/common/xml.h> #include <pacemaker-controld.h> @@ -41,7 +40,8 @@ do_te_control(long long action, controld_globals.transition_graph = NULL; if (cib_conn != NULL) { - cib_conn->cmds->del_notify_callback(cib_conn, T_CIB_DIFF_NOTIFY, + cib_conn->cmds->del_notify_callback(cib_conn, + PCMK__VALUE_CIB_DIFF_NOTIFY, te_update_diff); } @@ -71,12 +71,11 @@ do_te_control(long long action, crm_err("Could not set CIB callbacks"); init_ok = FALSE; - } else { - if (cib_conn->cmds->add_notify_callback(cib_conn, T_CIB_DIFF_NOTIFY, - te_update_diff) != pcmk_ok) { - crm_err("Could not set CIB notification callback"); - init_ok = FALSE; - } + } else if (cib_conn->cmds->add_notify_callback(cib_conn, + PCMK__VALUE_CIB_DIFF_NOTIFY, + te_update_diff) != pcmk_ok) { + crm_err("Could not set CIB notification callback"); + init_ok = FALSE; } if (init_ok) { @@ -110,13 +109,15 @@ do_te_invoke(long long action, if (action & A_TE_CANCEL) { crm_debug("Cancelling the transition: %sactive", controld_globals.transition_graph->complete? "in" : ""); - abort_transition(INFINITY, pcmk__graph_restart, "Peer Cancelled", NULL); + abort_transition(PCMK_SCORE_INFINITY, pcmk__graph_restart, + "Peer Cancelled", NULL); if (!controld_globals.transition_graph->complete) { crmd_fsa_stall(FALSE); } } else if (action & A_TE_HALT) { - abort_transition(INFINITY, pcmk__graph_wait, "Peer Halt", NULL); + abort_transition(PCMK_SCORE_INFINITY, pcmk__graph_wait, "Peer Halt", + NULL); if (!controld_globals.transition_graph->complete) { crmd_fsa_stall(FALSE); } @@ -124,11 +125,11 @@ do_te_invoke(long long action, } else if (action & A_TE_INVOKE) { ha_msg_input_t *input = fsa_typed_data(fsa_dt_ha_msg); xmlNode *graph_data = input->xml; - const char *ref = crm_element_value(input->msg, XML_ATTR_REFERENCE); - const char *graph_file = crm_element_value(input->msg, F_CRM_TGRAPH); - const char *graph_input = crm_element_value(input->msg, F_CRM_TGRAPH_INPUT); + const char *ref = crm_element_value(input->msg, PCMK_XA_REFERENCE); + const char *graph_input = crm_element_value(input->msg, + PCMK__XA_CRM_TGRAPH_IN); - if (graph_file == NULL && graph_data == NULL) { + if (graph_data == NULL) { crm_log_xml_err(input->msg, "Bad command"); register_fsa_error(C_FSA_INTERNAL, I_FAIL, NULL); return; @@ -136,8 +137,8 @@ do_te_invoke(long long action, if (!controld_globals.transition_graph->complete) { crm_info("Another transition is already active"); - abort_transition(INFINITY, pcmk__graph_restart, "Transition Active", - NULL); + abort_transition(PCMK_SCORE_INFINITY, pcmk__graph_restart, + "Transition Active", NULL); return; } @@ -147,14 +148,10 @@ do_te_invoke(long long action, crm_info("Transition is redundant: %s expected but %s received", pcmk__s(controld_globals.fsa_pe_ref, "no reference"), pcmk__s(ref, "no reference")); - abort_transition(INFINITY, pcmk__graph_restart, + abort_transition(PCMK_SCORE_INFINITY, pcmk__graph_restart, "Transition Redundant", NULL); } - if (graph_data == NULL && graph_file != NULL) { - graph_data = filename2xml(graph_file); - } - if (controld_is_started_transition_timer()) { crm_debug("The transitioner wait for a transition timer"); return; |