12 #include <sys/param.h> 59 #define XPATH_DEPRECATED_RULES \ 60 "//" PCMK_XE_OP_DEFAULTS "//" PCMK_XE_EXPRESSION \ 61 "|//" PCMK_XE_OP "//" PCMK_XE_EXPRESSION 76 if (deprecated != NULL) {
78 "Support for rules with node attribute expressions in " 80 "and will be dropped in a future release");
98 const char *new_version = NULL;
99 xmlNode *section = NULL;
108 pcmk__config_err(
"Can't process CIB with feature set '%s' greater than our own '%s'",
150 "due to lack of quorum");
181 crm_trace(
"Cluster resource count: %d (%d disabled, %d blocked)",
202 pe_free_resources(GList *resources)
205 GList *iterator = resources;
207 while (iterator != NULL) {
209 iterator = iterator->next;
212 if (resources != NULL) {
213 g_list_free(resources);
218 pe_free_actions(GList *actions)
220 GList *iterator = actions;
222 while (iterator != NULL) {
224 iterator = iterator->next;
226 if (actions != NULL) {
227 g_list_free(actions);
232 pe_free_nodes(GList *nodes)
234 for (GList *iterator = nodes; iterator != NULL; iterator = iterator->next) {
249 crm_trace(
"Freeing node %s", (pcmk__is_pacemaker_remote_node(node)?
250 "(guest or remote)" : pcmk__node_name(node)));
272 pe__free_ordering(GList *constraints)
274 GList *iterator = constraints;
276 while (iterator != NULL) {
279 iterator = iterator->next;
285 if (constraints != NULL) {
286 g_list_free(constraints);
291 pe__free_location(GList *constraints)
293 GList *iterator = constraints;
295 while (iterator != NULL) {
298 iterator = iterator->next;
300 g_list_free_full(cons->
nodes, free);
304 if (constraints != NULL) {
305 g_list_free(constraints);
383 crm_trace(
"Deleting %d ordering constraints",
388 crm_trace(
"Deleting %d location constraints",
393 crm_trace(
"Deleting %d colocation constraints",
398 crm_trace(
"Deleting %d ticket constraints",
420 #if PCMK__CONCURRENT_FENCING_DEFAULT_TRUE 445 for (rIter = rsc_list;
id && rIter; rIter = rIter->next) {
477 if ((match == NULL) && (
uname != NULL)) {
494 for (
const GList *iter = nodes; iter != NULL; iter = iter->next) {
#define CRM_CHECK(expr, failure_action)
enum pe_quorum_policy no_quorum_policy
#define PCMK_XE_FENCING_TOPOLOGY
#define PCMK_XE_OP_DEFAULTS
void pe_free_working_set(pcmk_scheduler_t *scheduler)
Free scheduler data.
pe_find
Search options for resources (exact resource ID always matches)
#define PCMK_XE_RSC_DEFAULTS
pcmk_resource_t * pe_find_resource_with_flags(GList *rsc_list, const char *id, enum pe_find flags)
#define pcmk__config_err(fmt...)
#define PCMK_XA_HAVE_QUORUM
pcmk_scheduler_t * pe_new_working_set(void)
Create a new object to hold scheduler data.
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
bool pcmk__xe_attr_is_true(const xmlNode *node, const char *name)
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
G_GNUC_INTERNAL gboolean unpack_resources(const xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
pcmk_node_t * pe_find_node_id(const GList *nodes, const char *id)
Find a node by ID in a list of nodes.
Also match clone instance ID from resource history.
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler)
GList * ticket_constraints
void(* free)(pcmk_resource_t *rsc)
pcmk_node_t * pcmk__find_node_in_list(const GList *nodes, const char *node_name)
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
gboolean cluster_status(pcmk_scheduler_t *scheduler)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
#define crm_trace(fmt, args...)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define pcmk__clear_scheduler_flags(scheduler, flags_to_clear)
struct pe_node_shared_s * details
Wrappers for and extensions to libxml2.
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler)
void free_xml(xmlNode *child)
void cleanup_calculations(pcmk_scheduler_t *scheduler)
Reset scheduler data to defaults without freeing it or constraints.
#define pcmk__warn_once(wo_flag, fmt...)
#define PCMK_XA_CRM_FEATURE_SET
G_GNUC_INTERNAL void pcmk__unpack_fencing_topology(const xmlNode *xml_fencing_topology, pcmk_scheduler_t *scheduler)
GList * ordering_constraints
pcmk_scheduler_t * scheduler
Deprecated Pacemaker scheduler utilities.
crm_time_t * crm_time_new(const char *string)
GList * colocation_constraints
#define pcmk__sched_warn(fmt...)
void pe_free_action(pcmk_action_t *action)
pcmk_node_t * pe_find_node_any(const GList *nodes, const char *id, const char *uname)
Find a node by name or ID in a list of nodes.
GHashTable * digest_cache
GList * placement_constraints
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler)
Location constraint object.
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
pcmk_resource_t * pe_find_resource(GList *rsc_list, const char *id)
void pe_reset_working_set(pcmk_scheduler_t *scheduler)
Reset scheduler data to default state without freeing it.
#define PCMK_XE_RESOURCES
#define pcmk__set_scheduler_flags(scheduler, flags_to_set)
GHashTable * template_rsc_sets
G_GNUC_INTERNAL gboolean unpack_tags(xmlNode *xml_tags, pcmk_scheduler_t *scheduler)
#define XPATH_DEPRECATED_RULES
#define PCMK_XE_CRM_CONFIG
int pcmk__check_feature_set(const char *cib_version)
void crm_time_free(crm_time_t *dt)
pcmk_node_t * pe_find_node(const GList *nodes, const char *node_name)
Find a node by name in a list of nodes.