diff options
Diffstat (limited to '')
-rw-r--r-- | include/pcmki/Makefile.am | 16 | ||||
-rw-r--r-- | include/pcmki/pcmki_agents.h | 19 | ||||
-rw-r--r-- | include/pcmki/pcmki_cluster_queries.h | 7 | ||||
-rw-r--r-- | include/pcmki/pcmki_resource.h | 8 | ||||
-rw-r--r-- | include/pcmki/pcmki_sched_allocate.h | 50 | ||||
-rw-r--r-- | include/pcmki/pcmki_sched_utils.h | 33 | ||||
-rw-r--r-- | include/pcmki/pcmki_scheduler.h | 31 | ||||
-rw-r--r-- | include/pcmki/pcmki_simulate.h | 26 | ||||
-rw-r--r-- | include/pcmki/pcmki_status.h | 8 | ||||
-rw-r--r-- | include/pcmki/pcmki_transition.h | 2 |
10 files changed, 64 insertions, 136 deletions
diff --git a/include/pcmki/Makefile.am b/include/pcmki/Makefile.am index b379fdb..b9475af 100644 --- a/include/pcmki/Makefile.am +++ b/include/pcmki/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2019-2022 the Pacemaker project contributors +# Copyright 2019-2023 the Pacemaker project contributors # # The version control history for this file may have further details. # @@ -9,18 +9,6 @@ MAINTAINERCLEANFILES = Makefile.in -noinst_HEADERS = pcmki_acl.h \ - pcmki_cluster_queries.h \ - pcmki_fence.h \ - pcmki_output.h \ - pcmki_resource.h \ - pcmki_result_code.h \ - pcmki_rule.h \ - pcmki_sched_allocate.h \ - pcmki_sched_utils.h \ - pcmki_scheduler.h \ - pcmki_simulate.h \ - pcmki_status.h \ - pcmki_transition.h +noinst_HEADERS = $(wildcard *.h) .PHONY: $(ARCHIVE_VERSION) diff --git a/include/pcmki/pcmki_agents.h b/include/pcmki/pcmki_agents.h new file mode 100644 index 0000000..eefe3e5 --- /dev/null +++ b/include/pcmki/pcmki_agents.h @@ -0,0 +1,19 @@ +/* + * Copyright 2023 the Pacemaker project contributors + * + * The version control history for this file may have further details. + * + * This source code is licensed under the GNU Lesser General Public License + * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. + */ +#ifndef PCMK__PCMKI_PCMKI_AGENTS__H +#define PCMK__PCMKI_PCMKI_AGENTS__H + +#include <crm/common/output_internal.h> + +int pcmk__list_alternatives(pcmk__output_t *out, const char *agent_spec); +int pcmk__list_agents(pcmk__output_t *out, char *agent_spec); +int pcmk__list_providers(pcmk__output_t *out, const char *agent_spec); +int pcmk__list_standards(pcmk__output_t *out); + +#endif /* PCMK__PCMKI_PCMKI_AGENTS__H */ diff --git a/include/pcmki/pcmki_cluster_queries.h b/include/pcmki/pcmki_cluster_queries.h index 776aa27..3fa4c23 100644 --- a/include/pcmki/pcmki_cluster_queries.h +++ b/include/pcmki/pcmki_cluster_queries.h @@ -1,5 +1,5 @@ /* - * Copyright 2020-2022 the Pacemaker project contributors + * Copyright 2020-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -10,7 +10,8 @@ #ifndef PCMK__PCMKI_PCMKI_CLUSTER_QUERIES__H # define PCMK__PCMKI_PCMKI_CLUSTER_QUERIES__H -#include <glib.h> // gboolean, GMainLoop, etc. +#include <stdbool.h> +#include <stdint.h> #include <crm/crm.h> #include <crm/common/output_internal.h> @@ -19,7 +20,7 @@ // CIB queries int pcmk__list_nodes(pcmk__output_t *out, const char *node_types, - gboolean bash_export); + bool bash_export); // Controller queries int pcmk__controller_status(pcmk__output_t *out, const char *node_name, diff --git a/include/pcmki/pcmki_resource.h b/include/pcmki/pcmki_resource.h index dc8ac69..442bb1f 100644 --- a/include/pcmki/pcmki_resource.h +++ b/include/pcmki/pcmki_resource.h @@ -1,5 +1,5 @@ /* - * Copyright 2021-2022 the Pacemaker project contributors + * Copyright 2021-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -11,10 +11,10 @@ #include <glib.h> +#include <crm/common/scheduler.h> #include <crm/common/output_internal.h> -#include <crm/pengine/pe_types.h> -int pcmk__resource_digests(pcmk__output_t *out, pe_resource_t *rsc, - const pe_node_t *node, GHashTable *overrides); +int pcmk__resource_digests(pcmk__output_t *out, pcmk_resource_t *rsc, + const pcmk_node_t *node, GHashTable *overrides); #endif /* PCMK__PCMKI_PCMKI_RESOURCE__H */ diff --git a/include/pcmki/pcmki_sched_allocate.h b/include/pcmki/pcmki_sched_allocate.h deleted file mode 100644 index 32044ea..0000000 --- a/include/pcmki/pcmki_sched_allocate.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2004-2023 the Pacemaker project contributors - * - * The version control history for this file may have further details. - * - * This source code is licensed under the GNU Lesser General Public License - * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. - */ - -#ifndef PCMK__PCMKI_PCMKI_SCHED_ALLOCATE__H -# define PCMK__PCMKI_PCMKI_SCHED_ALLOCATE__H - -# include <glib.h> -# include <crm/common/xml.h> -# include <crm/pengine/status.h> -# include <crm/pengine/complex.h> -# include <crm/common/xml_internal.h> -# include <crm/pengine/internal.h> -# include <crm/common/xml.h> -# include <pcmki/pcmki_scheduler.h> - -pe_node_t *pcmk__bundle_allocate(pe_resource_t *rsc, const pe_node_t *prefer); -void pcmk__bundle_create_actions(pe_resource_t *rsc); -bool pcmk__bundle_create_probe(pe_resource_t *rsc, pe_node_t *node); -void pcmk__bundle_internal_constraints(pe_resource_t *rsc); -void pcmk__bundle_rsc_location(pe_resource_t *rsc, pe__location_t *constraint); -enum pe_action_flags pcmk__bundle_action_flags(pe_action_t *action, - const pe_node_t *node); -void pcmk__bundle_expand(pe_resource_t *rsc); -void pcmk__bundle_add_utilization(const pe_resource_t *rsc, - const pe_resource_t *orig_rsc, - GList *all_rscs, GHashTable *utilization); -void pcmk__bundle_shutdown_lock(pe_resource_t *rsc); - -void clone_create_actions(pe_resource_t *rsc); -void clone_internal_constraints(pe_resource_t *rsc); -void clone_rsc_location(pe_resource_t *rsc, pe__location_t *constraint); -enum pe_action_flags clone_action_flags(pe_action_t *action, - const pe_node_t *node); -void clone_expand(pe_resource_t *rsc); -bool clone_create_probe(pe_resource_t *rsc, pe_node_t *node); -void clone_append_meta(const pe_resource_t *rsc, xmlNode *xml); -void pcmk__clone_add_utilization(const pe_resource_t *rsc, - const pe_resource_t *orig_rsc, - GList *all_rscs, GHashTable *utilization); -void pcmk__clone_shutdown_lock(pe_resource_t *rsc); - -void pcmk__log_transition_summary(const char *filename); - -#endif diff --git a/include/pcmki/pcmki_sched_utils.h b/include/pcmki/pcmki_sched_utils.h deleted file mode 100644 index 3e6d52f..0000000 --- a/include/pcmki/pcmki_sched_utils.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2004-2023 the Pacemaker project contributors - * - * The version control history for this file may have further details. - * - * This source code is licensed under the GNU Lesser General Public License - * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. - */ - -#ifndef PCMK__PCMKI_PCMKI_SCHED_UTILS__H -# define PCMK__PCMKI_PCMKI_SCHED_UTILS__H - -#include <stdbool.h> // bool -#include <glib.h> // GList, GHashTable, gboolean, guint -#include <crm/lrmd.h> // lrmd_event_data_t -#include <crm/cib.h> // cib_t -#include <crm/pengine/pe_types.h> -#include <crm/common/xml_internal.h> -#include <crm/pengine/internal.h> -#include <pcmki/pcmki_scheduler.h> -#include <pcmki/pcmki_transition.h> -#include <pacemaker.h> - -/* Constraint helper functions */ -GList *pcmk__copy_node_list(const GList *list, bool reset); - -int copies_per_node(pe_resource_t * rsc); - -xmlNode *pcmk__create_history_xml(xmlNode *parent, lrmd_event_data_t *event, - const char *caller_version, int target_rc, - const char *node, const char *origin); - -#endif diff --git a/include/pcmki/pcmki_scheduler.h b/include/pcmki/pcmki_scheduler.h index dde50a5..9adb9a9 100644 --- a/include/pcmki/pcmki_scheduler.h +++ b/include/pcmki/pcmki_scheduler.h @@ -8,36 +8,37 @@ */ #ifndef PCMK__PCMKI_PCMKI_SCHEDULER__H -# define PCMK__PCMKI_PCMKI_SCHEDULER__H +#define PCMK__PCMKI_PCMKI_SCHEDULER__H -# include <glib.h> -# include <crm/crm.h> -# include <crm/common/iso8601.h> -# include <crm/pengine/rules.h> -# include <crm/pengine/common.h> -# include <crm/pengine/status.h> +#include <glib.h> // GList +#include <stdbool.h> // bool +#include <libxml/tree.h> // xmlNode -# include <crm/pengine/complex.h> +#include <crm/lrmd_events.h> // lrmd_event_data_t +#include <crm/pengine/status.h> // pcmk_resource_t, pcmk_scheduler_t typedef struct { const char *id; const char *node_attribute; - pe_resource_t *dependent; // The resource being colocated - pe_resource_t *primary; // The resource the dependent is colocated with + pcmk_resource_t *dependent; // The resource being colocated + pcmk_resource_t *primary; // The resource the dependent is colocated with int dependent_role; // Colocation applies only if dependent has this role int primary_role; // Colocation applies only if primary has this role int score; - bool influence; // Whether dependent influences active primary placement + uint32_t flags; // Group of enum pcmk__coloc_flags } pcmk__colocation_t; -void pcmk__unpack_constraints(pe_working_set_t *data_set); +void pcmk__unpack_constraints(pcmk_scheduler_t *scheduler); void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags, - pe_working_set_t *data_set); + pcmk_scheduler_t *scheduler); -GList *pcmk__with_this_colocations(const pe_resource_t *rsc); -GList *pcmk__this_with_colocations(const pe_resource_t *rsc); +GList *pcmk__copy_node_list(const GList *list, bool reset); + +xmlNode *pcmk__create_history_xml(xmlNode *parent, lrmd_event_data_t *event, + const char *caller_version, int target_rc, + const char *node, const char *origin); #endif diff --git a/include/pcmki/pcmki_simulate.h b/include/pcmki/pcmki_simulate.h index 0b09903..ab73411 100644 --- a/include/pcmki/pcmki_simulate.h +++ b/include/pcmki/pcmki_simulate.h @@ -1,5 +1,5 @@ /* - * Copyright 2021-2022 the Pacemaker project contributors + * Copyright 2021-2023 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -11,7 +11,7 @@ # define PCMK__PCMKI_PCMKI_SIMULATE__H #include <crm/common/output_internal.h> -#include <crm/pengine/pe_types.h> +#include <crm/common/scheduler.h> #include <pcmki/pcmki_transition.h> #include <crm/cib.h> // cib_t #include <pacemaker.h> @@ -24,28 +24,28 @@ * CIB file in a given directory, printing the profiling timings for * each. * - * \note \p data_set->priv must have been set to a valid \p pcmk__output_t + * \note \p scheduler->priv must have been set to a valid \p pcmk__output_t * object before this function is called. * - * \param[in] dir A directory full of CIB files to be profiled - * \param[in] repeat Number of times to run on each input file - * \param[in,out] data_set Working set for the cluster - * \param[in] use_date The date to set the cluster's time to (may be NULL) + * \param[in] dir A directory full of CIB files to be profiled + * \param[in] repeat Number of times to run on each input file + * \param[in,out] scheduler Scheduler data + * \param[in] use_date The date to set the cluster's time to (may be NULL) */ -void pcmk__profile_dir(const char *dir, long long repeat, pe_working_set_t *data_set, - const char *use_date); +void pcmk__profile_dir(const char *dir, long long repeat, + pcmk_scheduler_t *scheduler, const char *use_date); /*! * \internal * \brief Simulate executing a transition * - * \param[in,out] data_set Cluster working set + * \param[in,out] scheduler Scheduler data * \param[in,out] cib CIB object for scheduler input * \param[in] op_fail_list List of actions to simulate as failing * * \return Transition status after simulated execution */ -enum pcmk__graph_status pcmk__simulate_transition(pe_working_set_t *data_set, +enum pcmk__graph_status pcmk__simulate_transition(pcmk_scheduler_t *scheduler, cib_t *cib, const GList *op_fail_list); @@ -58,7 +58,7 @@ enum pcmk__graph_status pcmk__simulate_transition(pe_working_set_t *data_set, * optionally writes out a variety of artifacts to show the results of the * simulation. Output can be modified with various flags. * - * \param[in,out] data_set Working set for the cluster + * \param[in,out] scheduler Scheduler data * \param[in,out] out The output functions structure * \param[in] injections A structure containing cluster events * (node up/down, tickets, injected operations) @@ -80,7 +80,7 @@ enum pcmk__graph_status pcmk__simulate_transition(pe_working_set_t *data_set, * * \return Standard Pacemaker return code */ -int pcmk__simulate(pe_working_set_t *data_set, pcmk__output_t *out, +int pcmk__simulate(pcmk_scheduler_t *scheduler, pcmk__output_t *out, const pcmk_injections_t *injections, unsigned int flags, uint32_t section_opts, const char *use_date, const char *input_file, const char *graph_file, diff --git a/include/pcmki/pcmki_status.h b/include/pcmki/pcmki_status.h index 6b48069..01139bb 100644 --- a/include/pcmki/pcmki_status.h +++ b/include/pcmki/pcmki_status.h @@ -13,7 +13,7 @@ #include <stdint.h> #include <crm/cib/cib_types.h> -#include <crm/pengine/pe_types.h> +#include <crm/common/scheduler.h> #include <crm/common/ipc_pacemakerd.h> #include <crm/common/output_internal.h> #include <pcmki/pcmki_fence.h> @@ -26,8 +26,8 @@ extern "C" { * \internal * \brief Print one-line status suitable for use with monitoring software * - * \param[in,out] out Output object - * \param[in] data_set Cluster working set + * \param[in,out] out Output object + * \param[in] scheduler Scheduler data * * \return Standard Pacemaker return code * @@ -39,7 +39,7 @@ extern "C" { * callers should be added. */ int pcmk__output_simple_status(pcmk__output_t *out, - const pe_working_set_t *data_set); + const pcmk_scheduler_t *scheduler); int pcmk__output_cluster_status(pcmk__output_t *out, stonith_t *stonith, cib_t *cib, xmlNode *current_cib, diff --git a/include/pcmki/pcmki_transition.h b/include/pcmki/pcmki_transition.h index 5dc3101..93237ed 100644 --- a/include/pcmki/pcmki_transition.h +++ b/include/pcmki/pcmki_transition.h @@ -14,6 +14,7 @@ # include <crm/crm.h> # include <crm/msg_xml.h> # include <crm/common/xml.h> +# include <crm/lrmd_events.h> // lrmd_event_data_t #ifdef __cplusplus extern "C" { @@ -164,6 +165,7 @@ void pcmk__free_graph(pcmk__graph_t *graph); const char *pcmk__graph_status2text(enum pcmk__graph_status state); void pcmk__log_graph(unsigned int log_level, pcmk__graph_t *graph); void pcmk__log_graph_action(int log_level, pcmk__graph_action_t *action); +void pcmk__log_transition_summary(const char *filename); lrmd_event_data_t *pcmk__event_from_graph_action(const xmlNode *resource, const pcmk__graph_action_t *action, int status, int rc, |