diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:45:40 +0000 |
commit | 07d7f4cfa4b10de87a31b68191036ff446add675 (patch) | |
tree | 7162524d8aaf1aef62d2f4fa51f595ed113981ff /daemons/schedulerd | |
parent | Adding upstream version 2.1.6. (diff) | |
download | pacemaker-07d7f4cfa4b10de87a31b68191036ff446add675.tar.xz pacemaker-07d7f4cfa4b10de87a31b68191036ff446add675.zip |
Adding upstream version 2.1.7.upstream/2.1.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemons/schedulerd')
-rw-r--r-- | daemons/schedulerd/Makefile.am | 22 | ||||
-rw-r--r-- | daemons/schedulerd/pacemaker-schedulerd.h | 4 | ||||
-rw-r--r-- | daemons/schedulerd/schedulerd_messages.c | 34 |
3 files changed, 34 insertions, 26 deletions
diff --git a/daemons/schedulerd/Makefile.am b/daemons/schedulerd/Makefile.am index 57e819b..fab8e1a 100644 --- a/daemons/schedulerd/Makefile.am +++ b/daemons/schedulerd/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2004-2021 the Pacemaker project contributors +# Copyright 2004-2023 the Pacemaker project contributors # # The version control history for this file may have further details. # @@ -10,7 +10,8 @@ include $(top_srcdir)/mk/common.mk include $(top_srcdir)/mk/man.mk -AM_CPPFLAGS += -I$(top_builddir) -I$(top_srcdir) +AM_CPPFLAGS += -I$(top_builddir) \ + -I$(top_srcdir) halibdir = $(CRM_DAEMON_DIR) @@ -26,27 +27,34 @@ endif noinst_HEADERS = pacemaker-schedulerd.h -pacemaker_schedulerd_CFLAGS = $(CFLAGS_HARDENED_EXE) +pacemaker_schedulerd_CFLAGS = $(CFLAGS_HARDENED_EXE) pacemaker_schedulerd_LDFLAGS = $(LDFLAGS_HARDENED_EXE) -pacemaker_schedulerd_LDADD = $(top_builddir)/lib/common/libcrmcommon.la \ - $(top_builddir)/lib/pengine/libpe_status.la \ - $(top_builddir)/lib/pacemaker/libpacemaker.la +pacemaker_schedulerd_LDADD = $(top_builddir)/lib/pacemaker/libpacemaker.la +pacemaker_schedulerd_LDADD += $(top_builddir)/lib/pengine/libpe_status.la +pacemaker_schedulerd_LDADD += $(top_builddir)/lib/common/libcrmcommon.la + # libcib for get_object_root() pacemaker_schedulerd_SOURCES = pacemaker-schedulerd.c pacemaker_schedulerd_SOURCES += schedulerd_messages.c +.PHONY: install-exec-local install-exec-local: $(INSTALL) -d -m 750 $(DESTDIR)/$(PE_STATE_DIR) -chown $(CRM_DAEMON_USER):$(CRM_DAEMON_GROUP) $(DESTDIR)/$(PE_STATE_DIR) -if BUILD_LEGACY_LINKS +.PHONY: install-exec-hook install-exec-hook: +if BUILD_LEGACY_LINKS cd $(DESTDIR)$(CRM_DAEMON_DIR) && rm -f pengine && $(LN_S) pacemaker-schedulerd pengine +endif +.PHONY: uninstall-hook uninstall-hook: +if BUILD_LEGACY_LINKS cd $(DESTDIR)$(CRM_DAEMON_DIR) && rm -f pengine endif +.PHONY: uninstall-local uninstall-local: -rmdir $(DESTDIR)/$(PE_STATE_DIR) diff --git a/daemons/schedulerd/pacemaker-schedulerd.h b/daemons/schedulerd/pacemaker-schedulerd.h index cbb07e1..75b7d38 100644 --- a/daemons/schedulerd/pacemaker-schedulerd.h +++ b/daemons/schedulerd/pacemaker-schedulerd.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2022 the Pacemaker project contributors + * Copyright 2004-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -11,7 +11,7 @@ #define PCMK__PACEMAKER_SCHEDULERD__H #include <crm_internal.h> -#include <crm/pengine/pe_types.h> +#include <crm/common/scheduler.h> extern pcmk__output_t *logger_out; extern pcmk__output_t *out; diff --git a/daemons/schedulerd/schedulerd_messages.c b/daemons/schedulerd/schedulerd_messages.c index 1c124d2..5a97365 100644 --- a/daemons/schedulerd/schedulerd_messages.c +++ b/daemons/schedulerd/schedulerd_messages.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2022 the Pacemaker project contributors + * Copyright 2004-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -22,12 +22,12 @@ static GHashTable *schedulerd_handlers = NULL; -static pe_working_set_t * +static pcmk_scheduler_t * init_working_set(void) { - pe_working_set_t *data_set = pe_new_working_set(); + pcmk_scheduler_t *scheduler = pe_new_working_set(); - CRM_ASSERT(data_set != NULL); + CRM_ASSERT(scheduler != NULL); crm_config_error = FALSE; crm_config_warning = FALSE; @@ -35,8 +35,8 @@ init_working_set(void) was_processing_error = FALSE; was_processing_warning = FALSE; - data_set->priv = logger_out; - return data_set; + scheduler->priv = logger_out; + return scheduler; } static xmlNode * @@ -72,7 +72,7 @@ handle_pecalc_request(pcmk__request_t *request) xmlNode *reply = NULL; bool is_repoke = false; bool process = true; - pe_working_set_t *data_set = init_working_set(); + pcmk_scheduler_t *scheduler = init_working_set(); pcmk__ipc_send_ack(request->ipc_client, request->ipc_id, request->ipc_flags, "ack", NULL, CRM_EX_INDETERMINATE); @@ -81,9 +81,9 @@ handle_pecalc_request(pcmk__request_t *request) CRM_FEATURE_SET); converted = copy_xml(xml_data); if (!cli_config_update(&converted, NULL, TRUE)) { - data_set->graph = create_xml_node(NULL, XML_TAG_GRAPH); - crm_xml_add_int(data_set->graph, "transition_id", 0); - crm_xml_add_int(data_set->graph, "cluster-delay", 0); + scheduler->graph = create_xml_node(NULL, XML_TAG_GRAPH); + crm_xml_add_int(scheduler->graph, "transition_id", 0); + crm_xml_add_int(scheduler->graph, "cluster-delay", 0); process = false; free(digest); @@ -98,9 +98,9 @@ handle_pecalc_request(pcmk__request_t *request) if (process) { pcmk__schedule_actions(converted, - pe_flag_no_counts - |pe_flag_no_compat - |pe_flag_show_utilization, data_set); + pcmk_sched_no_counts + |pcmk_sched_no_compat + |pcmk_sched_show_utilization, scheduler); } // Get appropriate index into series[] array @@ -112,7 +112,7 @@ handle_pecalc_request(pcmk__request_t *request) series_id = 2; } - value = pe_pref(data_set->config_hash, series[series_id].param); + value = pe_pref(scheduler->config_hash, series[series_id].param); if ((value == NULL) || (pcmk__scan_min_int(value, &series_wrap, -1) != pcmk_rc_ok)) { series_wrap = series[series_id].wrap; @@ -126,8 +126,8 @@ handle_pecalc_request(pcmk__request_t *request) crm_trace("Series %s: wrap=%d, seq=%u, pref=%s", series[series_id].name, series_wrap, seq, value); - data_set->input = NULL; - reply = create_reply(msg, data_set->graph); + scheduler->input = NULL; + reply = create_reply(msg, scheduler->graph); if (reply == NULL) { pcmk__format_result(&request->result, CRM_EX_ERROR, PCMK_EXEC_ERROR, @@ -172,7 +172,7 @@ handle_pecalc_request(pcmk__request_t *request) done: free_xml(converted); - pe_free_working_set(data_set); + pe_free_working_set(scheduler); return reply; } |