12 #include <sys/param.h> 66 #define XPATH_DEPRECATED_RULES \ 67 "//" PCMK_XE_OP_DEFAULTS "//" PCMK_XE_EXPRESSION \ 68 "|//" PCMK_XE_OP "//" PCMK_XE_EXPRESSION 83 if (deprecated != NULL) {
85 "Support for rules with node attribute expressions in " 87 "and will be dropped in a future release");
105 const char *new_version = NULL;
106 xmlNode *section = NULL;
115 pcmk__config_err(
"Can't process CIB with feature set '%s' greater than our own '%s'",
154 "Fencing and resource management disabled " 155 "due to lack of quorum");
183 item != NULL; item = item->next) {
189 crm_trace(
"Cluster resource count: %d (%d disabled, %d blocked)",
198 crm_info(
"Creating a fake local node for %s",
220 pe_free_resources(GList *resources)
223 GList *iterator = resources;
225 while (iterator != NULL) {
227 iterator = iterator->next;
230 if (resources != NULL) {
231 g_list_free(resources);
236 pe_free_actions(GList *actions)
238 GList *iterator = actions;
240 while (iterator != NULL) {
242 iterator = iterator->next;
244 if (actions != NULL) {
245 g_list_free(actions);
250 pe_free_nodes(GList *nodes)
252 for (GList *iterator = nodes; iterator != NULL; iterator = iterator->next) {
267 crm_trace(
"Freeing node %s", (pcmk__is_pacemaker_remote_node(node)?
268 "(guest or remote)" : pcmk__node_name(node)));
292 pe__free_ordering(GList *constraints)
294 GList *iterator = constraints;
296 while (iterator != NULL) {
299 iterator = iterator->next;
305 if (constraints != NULL) {
306 g_list_free(constraints);
311 pe__free_location(GList *constraints)
313 GList *iterator = constraints;
315 while (iterator != NULL) {
318 iterator = iterator->next;
324 if (constraints != NULL) {
325 g_list_free(constraints);
399 crm_trace(
"Deleting %d ordering constraints",
404 crm_trace(
"Deleting %d location constraints",
409 crm_trace(
"Deleting %d colocation constraints",
438 #if PCMK__CONCURRENT_FENCING_DEFAULT_TRUE 463 for (rIter = rsc_list;
id && rIter; rIter = rIter->next) {
495 if ((match == NULL) && (
uname != NULL)) {
512 for (
const GList *iter = nodes; iter != NULL; iter = iter->next) {
pcmk_node_t * pcmk_find_node(const pcmk_scheduler_t *scheduler, const char *node_name)
Find a node by name in scheduler data.
#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...)
GList * location_constraints
#define PCMK_XA_HAVE_QUORUM
pcmk_scheduler_t * pe_new_working_set(void)
Create a new object to hold scheduler data.
pcmk__scheduler_private_t * priv
pcmk_node_t * pe_create_node(const char *id, const char *uname, const char *type, int score, pcmk_scheduler_t *scheduler)
GHashTable * ticket_constraints
Stop all resources in partition.
#define CRM_LOG_ASSERT(expr)
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
const pcmk__rsc_methods_t * fns
bool pcmk__xe_attr_is_true(const xmlNode *node, const char *name)
G_GNUC_INTERNAL void pcmk__validate_fencing_topology(const xmlNode *xml)
void pcmk__free_node_copy(void *data)
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)
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
enum pe_quorum_policy no_quorum_policy
pcmk_node_t * pe_find_node_id(const GList *nodes, const char *id)
Find a node by ID in a list of nodes.
GList * ordering_constraints
void pcmk__xml_free(xmlNode *xml)
Also match clone instance ID from resource history.
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler)
pcmk__node_private_t * priv
void(* count)(pcmk_resource_t *rsc)
pcmk_node_t * pcmk__find_node_in_list(const GList *nodes, const char *node_name)
gboolean cluster_status(pcmk_scheduler_t *scheduler)
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
GList * colocation_constraints
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#define crm_trace(fmt, args...)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
GList * assigned_resources
#define pcmk__clear_scheduler_flags(scheduler, flags_to_clear)
pcmk__resource_private_t * priv
Wrappers for and extensions to libxml2.
Act as if partition still holds quorum.
GHashTable * digest_cache
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler)
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
#define pcmk__sched_warn(scheduler, fmt...)
pcmk_scheduler_t * scheduler
Deprecated Pacemaker scheduler utilities.
crm_time_t * crm_time_new(const char *string)
This structure contains everything that makes up a single output formatter.
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.
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler)
Location constraint object.
void(* free)(pcmk_resource_t *rsc)
struct pcmk__node_details * details
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 crm_info(fmt, args...)
#define PCMK_XE_RESOURCES
#define pcmk__set_scheduler_flags(scheduler, flags_to_set)
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)
struct pcmk__node_assignment * assign
pcmk_node_t * pe_find_node(const GList *nodes, const char *node_name)
Find a node by name in a list of nodes.