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/pacemakerd/pacemakerd.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/pacemakerd/pacemakerd.c')
-rw-r--r-- | daemons/pacemakerd/pacemakerd.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/daemons/pacemakerd/pacemakerd.c b/daemons/pacemakerd/pacemakerd.c index 365b743..5d5a1db 100644 --- a/daemons/pacemakerd/pacemakerd.c +++ b/daemons/pacemakerd/pacemakerd.c @@ -1,5 +1,5 @@ /* - * Copyright 2010-2023 the Pacemaker project contributors + * Copyright 2010-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -10,6 +10,10 @@ #include <crm_internal.h> #include "pacemakerd.h" +#if SUPPORT_COROSYNC +#include "pcmkd_corosync.h" +#endif + #include <pwd.h> #include <errno.h> #include <unistd.h> @@ -21,8 +25,8 @@ #include <sys/resource.h> #include <crm/crm.h> /* indirectly: CRM_EX_* */ -#include <crm/msg_xml.h> #include <crm/common/mainloop.h> +#include <crm/common/xml.h> #include <crm/common/cmdline_internal.h> #include <crm/common/ipc_pacemakerd.h> #include <crm/common/output_internal.h> @@ -60,19 +64,21 @@ static int pacemakerd_features_xml(pcmk__output_t *out, va_list args) { gchar **feature_list = g_strsplit(CRM_FEATURES, " ", 0); - pcmk__output_xml_create_parent(out, "pacemakerd", - "version", PACEMAKER_VERSION, - "build", BUILD_VERSION, - "feature_set", CRM_FEATURE_SET, + pcmk__output_xml_create_parent(out, PCMK_XE_PACEMAKERD, + PCMK_XA_VERSION, PACEMAKER_VERSION, + PCMK_XA_BUILD, BUILD_VERSION, + PCMK_XA_FEATURE_SET, CRM_FEATURE_SET, NULL); - out->begin_list(out, NULL, NULL, "features"); + out->begin_list(out, NULL, NULL, PCMK_XE_FEATURES); for (char **s = feature_list; *s != NULL; s++) { - pcmk__output_create_xml_text_node(out, "feature", *s); + pcmk__output_create_xml_text_node(out, PCMK_XE_FEATURE, *s); } out->end_list(out); + pcmk__output_xml_pop_parent(out); + g_strfreev(feature_list); return pcmk_rc_ok; } @@ -92,7 +98,7 @@ pid_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **er static gboolean standby_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **err) { options.standby = TRUE; - pcmk__set_env_option(PCMK__ENV_NODE_START_STATE, "standby", false); + pcmk__set_env_option(PCMK__ENV_NODE_START_STATE, PCMK_VALUE_STANDBY, false); return TRUE; } @@ -297,8 +303,6 @@ main(int argc, char **argv) goto done; } - pcmk__force_args(context, &error, "%s --xml-simple-list", g_get_prgname()); - pcmk__register_messages(out, fmt_functions); if (options.features) { @@ -313,7 +317,7 @@ main(int argc, char **argv) } // @COMPAT Drop at 3.0.0; likely last used in 1.1.24 - pcmk__set_env_option(PCMK__ENV_MCP, "true", true); + pcmk__set_env_option(PCMK__ENV_MCP, PCMK_VALUE_TRUE, true); if (options.shutdown) { pcmk__cli_init_logging("pacemakerd", args->verbosity); @@ -402,7 +406,7 @@ main(int argc, char **argv) { const char *facility = pcmk__env_option(PCMK__ENV_LOGFACILITY); - if (!pcmk__str_eq(facility, PCMK__VALUE_NONE, + if (!pcmk__str_eq(facility, PCMK_VALUE_NONE, pcmk__str_casei|pcmk__str_null_matches)) { pcmk__set_env_option("LOGFACILITY", facility, true); } @@ -444,7 +448,7 @@ main(int argc, char **argv) if ((running_with_sbd) && pcmk__get_sbd_sync_resource_startup()) { crm_notice("Waiting for startup-trigger from SBD."); - pacemakerd_state = XML_PING_ATTR_PACEMAKERDSTATE_WAITPING; + pacemakerd_state = PCMK__VALUE_WAIT_FOR_PING; startup_trigger = mainloop_add_trigger(G_PRIORITY_HIGH, init_children_processes, NULL); } else { if (running_with_sbd) { @@ -452,7 +456,7 @@ main(int argc, char **argv) "by your SBD version) improve reliability of " "interworking between SBD & pacemaker."); } - pacemakerd_state = XML_PING_ATTR_PACEMAKERDSTATE_STARTINGDAEMONS; + pacemakerd_state = PCMK__VALUE_STARTING_DAEMONS; init_children_processes(NULL); } |