26 #define INFINITY_HACK (PCMK_SCORE_INFINITY * -100) 58 if (colocation1 == NULL) {
61 if (colocation2 == NULL) {
95 if (pcmk__is_clone(
rsc1)) {
130 cmp_dependent_priority(gconstpointer a, gconstpointer b)
132 return cmp_colocation_priority(a, b,
true);
156 cmp_primary_priority(gconstpointer a, gconstpointer b)
158 return cmp_colocation_priority(a, b,
false);
176 CRM_ASSERT((list != NULL) && (colocation != NULL) && (rsc != NULL));
179 "Adding colocation %s (%s with %s using %s @%s) to " 180 "'this with' list for %s",
184 *list = g_list_insert_sorted(*list, (gpointer) colocation,
185 cmp_primary_priority);
210 *list = g_list_copy(addition);
216 for (
const GList *iter = addition; iter != NULL; iter = iter->next) {
236 CRM_ASSERT((list != NULL) && (colocation != NULL) && (rsc != NULL));
239 "Adding colocation %s (%s with %s using %s @%s) to " 240 "'with this' list for %s",
244 *list = g_list_insert_sorted(*list, (gpointer) colocation,
245 cmp_dependent_priority);
270 *list = g_list_copy(addition);
276 for (
const GList *iter = addition; iter != NULL; iter = iter->next) {
294 const char *first_tasks[] = { NULL, NULL };
295 const char *then_tasks[] = { NULL, NULL };
321 for (
int first_lpc = 0;
322 (first_lpc <= 1) && (first_tasks[first_lpc] != NULL); first_lpc++) {
324 for (
int then_lpc = 0;
325 (then_lpc <= 1) && (then_tasks[then_lpc] != NULL); then_lpc++) {
328 then_rsc, then_tasks[then_lpc],
350 const char *dependent_role,
const char *primary_role,
357 if ((dependent == NULL) || (primary == NULL)) {
359 "does not exist",
id);
365 "Ignoring colocation '%s' (%s with %s) because score is 0",
366 id, dependent->
id, primary->
id);
385 new_con->
score = score;
398 anti_colocation_order(dependent, new_con->
dependent_role, primary,
400 anti_colocation_order(primary, new_con->
primary_role, dependent,
419 const char *influence_s)
421 if (influence_s != NULL) {
439 unpack_colocation_set(xmlNode *
set,
int score,
const char *coloc_id,
442 xmlNode *xml_rsc = NULL;
445 const char *set_id = pcmk__xe_id(
set);
447 bool with_previous =
false;
448 int local_score = score;
449 bool sequential =
false;
451 const char *xml_rsc_id = NULL;
457 if (local_score == 0) {
458 crm_trace(
"Ignoring colocation '%s' for set '%s' because score is 0",
470 with_previous =
true;
475 " (such as %s) is deprecated and will be removed in a" 486 if (local_score > 0) {
491 xml_rsc_id = pcmk__xe_id(xml_rsc);
494 if (resource == NULL) {
497 "No such resource", xml_rsc_id, set_id);
502 | unpack_influence(coloc_id, resource, influence_s);
505 resource->
id, other->
id, set_id);
507 other, role, role,
flags);
510 other->
id, resource->
id, set_id);
512 resource, role, role,
flags);
528 xmlNode *xml_rsc_with = NULL;
530 xml_rsc_id = pcmk__xe_id(xml_rsc);
533 if (resource == NULL) {
536 "No such resource", xml_rsc_id, set_id);
540 | unpack_influence(coloc_id, resource, influence_s);
543 xml_rsc_with != NULL;
546 xml_rsc_id = pcmk__xe_id(xml_rsc_with);
554 resource, other, role, role,
flags);
573 colocate_rsc_sets(
const char *
id,
const xmlNode *set1,
const xmlNode *set2,
574 int score,
const char *influence_s,
577 xmlNode *xml_rsc = NULL;
581 const char *xml_rsc_id = NULL;
586 bool sequential =
false;
590 crm_trace(
"Ignoring colocation '%s' between sets %s and %s " 591 "because score is 0",
592 id, pcmk__xe_id(set1), pcmk__xe_id(set2));
600 if (xml_rsc != NULL) {
601 xml_rsc_id = pcmk__xe_id(xml_rsc);
607 "because first resource %s not found",
608 pcmk__xe_id(set1), pcmk__xe_id(set2),
622 xml_rsc_id = pcmk__xe_id(xml_rsc);
629 "because last resource %s not found",
630 pcmk__xe_id(set1), pcmk__xe_id(set2), xml_rsc_id);
635 if ((rsc_1 != NULL) && (rsc_2 != NULL)) {
640 }
else if (rsc_1 != NULL) {
646 xml_rsc_id = pcmk__xe_id(xml_rsc);
652 "in set %s: No such resource",
653 pcmk__xe_id(set1), xml_rsc_id,
661 }
else if (rsc_2 != NULL) {
666 xml_rsc_id = pcmk__xe_id(xml_rsc);
672 "with set %s: No such resource",
673 pcmk__xe_id(set1), xml_rsc_id,
678 | unpack_influence(
id, rsc_1, influence_s);
688 xmlNode *xml_rsc_2 = NULL;
690 xml_rsc_id = pcmk__xe_id(xml_rsc);
696 "with set %s: No such resource",
697 pcmk__xe_id(set1), xml_rsc_id,
703 | unpack_influence(
id, rsc_1, influence_s);
708 xml_rsc_id = pcmk__xe_id(xml_rsc_2);
714 "%s with set %s resource %s: No such " 716 pcmk__xe_id(set1), pcmk__xe_id(xml_rsc),
717 pcmk__xe_id(set2), xml_rsc_id);
721 role_1, role_2,
flags);
728 unpack_simple_colocation(xmlNode *xml_obj,
const char *
id,
742 const char *primary_instance = NULL;
743 const char *dependent_instance = NULL;
754 if (dependent_instance != NULL) {
757 "and will be removed in a future release");
759 if (primary_instance != NULL) {
762 "deprecated and will be removed in a future release");
765 if (dependent == NULL) {
767 "does not exist",
id, dependent_id);
770 }
else if (primary == NULL) {
772 "does not exist",
id, primary_id);
775 }
else if ((dependent_instance != NULL) && !pcmk__is_clone(dependent)) {
777 "is not a clone but instance '%s' was requested",
778 id, dependent_id, dependent_instance);
781 }
else if ((primary_instance != NULL) && !pcmk__is_clone(primary)) {
783 "is not a clone but instance '%s' was requested",
784 id, primary_id, primary_instance);
788 if (dependent_instance != NULL) {
790 if (dependent == NULL) {
792 "does not have an instance '%s'",
793 id, dependent_id, dependent_instance);
798 if (primary_instance != NULL) {
800 if (primary == NULL) {
802 "does not have an instance '%s'",
803 id, primary_id, primary_instance);
820 dependent_role, primary_role,
flags);
825 unpack_colocation_tags(xmlNode *xml_obj, xmlNode **expanded_xml,
828 const char *
id = NULL;
829 const char *dependent_id = NULL;
830 const char *primary_id = NULL;
831 const char *dependent_role = NULL;
832 const char *primary_role = NULL;
840 xmlNode *dependent_set = NULL;
841 xmlNode *primary_set = NULL;
842 bool any_sets =
false;
844 *expanded_xml = NULL;
846 CRM_CHECK(xml_obj != NULL,
return EINVAL);
848 id = pcmk__xe_id(xml_obj);
857 if (*expanded_xml != NULL) {
864 if ((dependent_id == NULL) || (primary_id == NULL)) {
871 "valid resource or tag",
id, dependent_id);
878 "valid resource or tag",
id, primary_id);
882 if ((dependent != NULL) && (primary != NULL)) {
887 if ((dependent_tag != NULL) && (primary_tag != NULL)) {
890 "tags cannot be colocated",
id);
905 *expanded_xml = NULL;
909 if (dependent_set != NULL) {
910 if (dependent_role != NULL) {
926 *expanded_xml = NULL;
930 if (primary_set != NULL) {
931 if (primary_role != NULL) {
945 *expanded_xml = NULL;
963 xmlNode *last = NULL;
965 xmlNode *orig_xml = NULL;
966 xmlNode *expanded_xml = NULL;
969 const char *score = NULL;
970 const char *influence_s = NULL;
972 if (pcmk__str_empty(
id)) {
978 if (unpack_colocation_tags(xml_obj, &expanded_xml,
982 if (expanded_xml != NULL) {
984 xml_obj = expanded_xml;
998 if (expanded_xml != NULL) {
1004 if (pcmk__str_empty(pcmk__xe_id(
set))) {
1009 unpack_colocation_set(
set, score_i,
id, influence_s,
scheduler);
1012 colocate_rsc_sets(
id, last,
set, score_i, influence_s,
scheduler);
1023 unpack_simple_colocation(xml_obj,
id, influence_s,
scheduler);
1042 for (iter = rsc->
actions; iter != NULL; iter = iter->next) {
1056 for (iter = rsc->
children; iter != NULL; iter = iter->next) {
1076 GList *colocations = NULL;
1078 bool is_start =
false;
1097 if (rsc->
parent != NULL) {
1102 for (iter = rsc->
children; iter != NULL; iter = iter->next) {
1107 if ((child_action == NULL)
1109 crm_trace(
"Not blocking %s colocation dependents because " 1110 "at least %s has runnable %s",
1116 crm_trace(
"Blocking %s colocation dependents due to unrunnable %s %s",
1121 for (iter = colocations; iter != NULL; iter = iter->next) {
1147 g_list_free(colocations);
1174 if (child != NULL) {
1207 CRM_ASSERT((dependent != NULL) && (primary != NULL)
1208 && (colocation != NULL));
1215 dependent_role_rsc = get_resource_for_role(dependent);
1216 primary_role_rsc = get_resource_for_role(primary);
1219 && (dependent_role_rsc->
parent != NULL)
1239 crm_trace(
"Skipping colocation '%s': %s will not run anywhere",
1240 colocation->
id, dependent->
id);
1245 if (!pcmk__same_node(primary_node, dependent->
allocated_to)) {
1248 dependent->
id, primary->
id,
1250 pcmk__node_name(primary_node));
1256 if (pcmk__same_node(dependent->
allocated_to, primary_node)) {
1258 "assigned to the same node (%s)",
1259 dependent->
id, primary->
id,
1260 pcmk__node_name(primary_node));
1268 crm_trace(
"Skipping %scolocation '%s': dependent limited to %s role " 1270 "but %s next role is %s",
1271 ((colocation->
score < 0)?
"anti-" :
""),
1273 dependent_role_rsc->
id,
1280 crm_trace(
"Skipping %scolocation '%s': primary limited to %s role " 1281 "but %s next role is %s",
1282 ((colocation->
score < 0)?
"anti-" :
""),
1284 primary_role_rsc->
id,
1309 const char *value = NULL;
1310 GHashTable *work = NULL;
1311 GHashTableIter iter;
1315 value = pcmk__colocation_node_attr(primary->
allocated_to, attr,
1318 }
else if (colocation->
score < 0) {
1325 g_hash_table_iter_init(&iter, work);
1326 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1330 "Applied %s to %s score on %s (now %s after " 1331 "subtracting %s because primary %s inactive)",
1332 colocation->
id, dependent->
id,
1333 pcmk__node_name(node),
1339 if (pcmk__str_eq(pcmk__colocation_node_attr(node, attr, dependent),
1352 "Applied %s to %s score on %s (now %s after " 1354 colocation->
id, dependent->
id,
1355 pcmk__node_name(node),
1370 "Banned %s from %s because colocation %s attribute %s " 1372 dependent->
id, pcmk__node_name(node),
1373 colocation->
id, attr);
1387 "%s: Rolling back scores from %s (no available nodes)",
1388 dependent->
id, primary->
id);
1392 g_hash_table_destroy(work);
1414 const char *dependent_value = NULL;
1415 const char *primary_value = NULL;
1417 int score_multiplier = 1;
1418 int priority_delta = 0;
1420 CRM_ASSERT((dependent != NULL) && (primary != NULL)
1421 && (colocation != NULL));
1444 dependent_value = pcmk__colocation_node_attr(dependent->
allocated_to, attr,
1446 primary_value = pcmk__colocation_node_attr(primary->
allocated_to, attr,
1457 score_multiplier = -1;
1468 score_multiplier = -1;
1471 priority_delta = score_multiplier * colocation->
score;
1474 "Applied %s to %s promotion priority (now %s after %s %d)",
1475 colocation->
id, dependent->
id,
1477 ((score_multiplier == 1)?
"adding" :
"subtracting"),
1480 return priority_delta;
1497 GHashTable *allowed_nodes_orig = NULL;
1498 GHashTableIter iter;
1501 const char *best_node = NULL;
1503 if ((colocation != NULL) && (rsc == colocation->
dependent)
1505 && pcmk__is_group(rsc->
parent)
1521 loc_iter != NULL; loc_iter = loc_iter->next) {
1533 while (g_hash_table_iter_next(&iter, NULL, (
void **) &node)) {
1535 if ((node->weight > best_score)
1537 && pcmk__str_eq(value, pcmk__colocation_node_attr(node, attr, rsc),
1540 best_score = node->weight;
1541 best_node = node->details->uname;
1546 if (best_node == NULL) {
1547 crm_info(
"No allowed node for %s matches node attribute %s=%s",
1548 rsc->
id, attr, value);
1550 crm_info(
"Allowed node %s for %s had best score (%d) " 1551 "of those matching node attribute %s=%s",
1552 best_node, rsc->
id, best_score, attr, value);
1556 if (allowed_nodes_orig != NULL) {
1574 GHashTableIter iter;
1576 int allowed_nodes = 0;
1579 while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &allowed_node)) {
1580 if ((allowed_node->weight >= 0) && (++allowed_nodes > 1)) {
1586 ((allowed_nodes == 1)?
"on a single node" :
"nowhere"));
1587 return (allowed_nodes == 1);
1609 add_node_scores_matching_attr(GHashTable *nodes,
1613 float factor,
bool only_positive)
1615 GHashTableIter iter;
1620 g_hash_table_iter_init(&iter, nodes);
1621 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1626 const char *value = pcmk__colocation_node_attr(node, attr, target_rsc);
1628 score = best_node_score_matching_attr(colocation, source_rsc, attr, value);
1630 if ((factor < 0) && (score < 0)) {
1665 || !pcmk__colocation_has_influence(colocation, NULL)
1666 || !allowed_on_one(colocation->
dependent)) {
1668 "(double negative disallowed)",
1669 pcmk__node_name(node), node->weight, factor, score);
1675 crm_trace(
"%s: Filtering %d + %f * %d (node was marked unusable)",
1676 pcmk__node_name(node), node->weight, factor, score);
1680 delta_f = factor * score;
1683 delta = (int) ((delta_f < 0)? (delta_f - 0.5) : (delta_f + 0.5));
1689 if ((delta == 0) && (score != 0)) {
1692 }
else if (factor < 0.0) {
1699 if (only_positive && (new_score < 0) && (node->weight > 0)) {
1700 crm_trace(
"%s: Filtering %d + %f * %d = %d " 1701 "(negative disallowed, marking node unusable)",
1702 pcmk__node_name(node), node->weight, factor, score,
1708 if (only_positive && (new_score < 0) && (node->weight == 0)) {
1709 crm_trace(
"%s: Filtering %d + %f * %d = %d (negative disallowed)",
1710 pcmk__node_name(node), node->weight, factor, score,
1715 crm_trace(
"%s: %d + %f * %d = %d", pcmk__node_name(node),
1716 node->weight, factor, score, new_score);
1717 node->weight = new_score;
1757 float factor, uint32_t
flags)
1759 GHashTable *work = NULL;
1761 CRM_ASSERT((source_rsc != NULL) && (nodes != NULL)
1762 && ((colocation != NULL)
1763 || ((target_rsc == NULL) && (*nodes == NULL))));
1765 if (log_id == NULL) {
1766 log_id = source_rsc->
id;
1772 log_id, source_rsc->
id);
1777 if (*nodes == NULL) {
1779 target_rsc = source_rsc;
1783 pcmk__rsc_trace(source_rsc,
"%s: Merging %s scores from %s (at %.6f)",
1784 log_id, (pos?
"positive" :
"all"), source_rsc->
id, factor);
1786 add_node_scores_matching_attr(work, source_rsc, target_rsc, colocation,
1796 GList *colocations = NULL;
1801 "Checking additional %d optional '%s with' " 1803 g_list_length(colocations), source_rsc->
id);
1807 "Checking additional %d optional 'with %s' " 1809 g_list_length(colocations), source_rsc->
id);
1813 for (GList *iter = colocations; iter != NULL; iter = iter->next) {
1817 float other_factor = factor * constraint->
score 1822 }
else if (!pcmk__colocation_has_influence(constraint, NULL)) {
1829 "Optionally merging score of '%s' constraint " 1835 other_factor,
flags);
1838 g_list_free(colocations);
1841 pcmk__rsc_info(source_rsc,
"%s: Rolling back optional scores from %s",
1842 log_id, source_rsc->
id);
1843 g_hash_table_destroy(work);
1851 GHashTableIter iter;
1853 g_hash_table_iter_init(&iter, work);
1854 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1861 if (*nodes != NULL) {
1862 g_hash_table_destroy(*nodes);
1886 if (!pcmk__colocation_has_influence(colocation, NULL)) {
1889 if (pcmk__is_clone(target_rsc)) {
1893 "%s: Incorporating attenuated %s assignment scores due " 1895 target_rsc->
id, source_rsc->
id, colocation->
id);
1899 colocation, factor,
flags);
1923 const GList *primary_nodes,
bool merge_scores)
1925 GHashTableIter iter;
1928 CRM_ASSERT((dependent != NULL) && (primary != NULL)
1929 && (colocation != NULL));
1932 while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &dependent_node)) {
1936 dependent_node->details->id);
1937 if (primary_node == NULL) {
1940 "Banning %s from %s (no primary instance) for %s",
1941 dependent->
id, pcmk__node_name(dependent_node),
1944 }
else if (merge_scores) {
1948 "Added %s's score %s to %s's score for %s (now %s) " 1949 "for colocation %s",
1951 dependent->
id, pcmk__node_name(dependent_node),
pcmk_assignment_methods_t * cmds
#define CRM_CHECK(expr, failure_action)
void pcmk__add_colocated_node_scores(pcmk_resource_t *source_rsc, const pcmk_resource_t *target_rsc, const char *log_id, GHashTable **nodes, const pcmk__colocation_t *colocation, float factor, uint32_t flags)
void pcmk__add_with_this(GList **list, const pcmk__colocation_t *colocation, const pcmk_resource_t *rsc)
xmlNode * pcmk__xml_copy(xmlNode *parent, xmlNode *src)
pcmk_scheduler_t * cluster
const char * pcmk_role_text(enum rsc_role_e role)
Get readable description of a resource role.
#define pcmk__if_tracing(if_action, else_action)
pcmk_resource_t * uber_parent(pcmk_resource_t *rsc)
const char * pcmk_readable_score(int score)
Return a displayable static string for a score value.
G_GNUC_INTERNAL bool pcmk__tag_to_set(xmlNode *xml_obj, xmlNode **rsc_set, const char *attr, bool convert_rsc, const pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL bool pcmk__any_node_available(GHashTable *nodes)
#define pcmk__config_warn(fmt...)
#define pcmk__rsc_trace(rsc, fmt, args...)
#define PCMK__XA_WITH_RSC_INSTANCE
#define PCMK_XE_RSC_COLOCATION
#define PCMK_XE_RESOURCE_REF
#define pcmk__rsc_info(rsc, fmt, args...)
enum rsc_role_e next_role
#define PCMK_XA_WITH_RSC_ROLE
#define pcmk__config_err(fmt...)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
void pe_action_set_reason(pcmk_action_t *action, const char *reason, bool overwrite)
void(* add_colocated_node_scores)(pcmk_resource_t *source_rsc, const pcmk_resource_t *target_rsc, const char *log_id, GHashTable **nodes, const pcmk__colocation_t *colocation, float factor, uint32_t flags)
#define PCMK__XA_RSC_INSTANCE
enum pcmk__coloc_affects pcmk__colocation_affects(const pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, bool preview)
bool pcmk__xe_attr_is_true(const xmlNode *node, const char *name)
G_GNUC_INTERNAL void pcmk__update_action_for_orderings(pcmk_action_t *action, pcmk_scheduler_t *scheduler)
#define PCMK__XA_ORDERING
void pcmk__add_this_with(GList **list, const pcmk__colocation_t *colocation, const pcmk_resource_t *rsc)
#define PCMK__VALUE_GROUP
void pcmk__unpack_colocation(xmlNode *xml_obj, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL bool pcmk__node_available(const pcmk_node_t *node, bool consider_score, bool consider_guest)
void pcmk__apply_coloc_to_scores(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation)
enum rsc_role_e pcmk_parse_role(const char *role)
Parse a resource role from a string role specification.
void pcmk__block_colocation_dependents(pcmk_action_t *action)
void(* with_this_colocations)(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
#define PCMK_ACTION_DEMOTE
G_GNUC_INTERNAL pcmk_resource_t * pcmk__find_constraint_resource(GList *rsc_list, const char *id)
const pcmk_resource_t * pe__get_rsc_in_container(const pcmk_resource_t *instance)
#define pcmk__clear_action_flags(action, flags_to_clear)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
pcmk_node_t * pe_find_node_id(const GList *node_list, const char *id)
Find a node by ID in a list of nodes.
xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
#define pcmk__sched_err(fmt...)
int char2score(const char *score)
Get the integer value of a score string.
void(* this_with_colocations)(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
#define crm_trace(fmt, args...)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
xmlNode * expand_idref(xmlNode *input, xmlNode *top)
#define PCMK_ACTION_START
int pcmk__xe_get_bool_attr(const xmlNode *node, const char *name, bool *value)
int pcmk__apply_coloc_to_priority(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation)
Wrappers for and extensions to libxml2.
void pcmk__xe_remove_attr(xmlNode *element, const char *name)
void(* apply_location)(pcmk_resource_t *rsc, pcmk__location_t *location)
void pcmk__add_this_with_list(GList **list, GList *addition, const pcmk_resource_t *rsc)
Ordering applies only if 'first' is required and on same node as 'then'.
#define PCMK_XA_INFLUENCE
void pcmk__colocation_intersect_nodes(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, const GList *primary_nodes, bool merge_scores)
#define pcmk__set_rsc_flags(resource, flags_to_set)
G_GNUC_INTERNAL bool pcmk__valid_resource_or_tag(const pcmk_scheduler_t *scheduler, const char *id, pcmk_resource_t **rsc, pcmk_tag_t **tag)
void free_xml(xmlNode *child)
int pcmk__add_scores(int score1, int score2)
enum pe_obj_types variant
#define pcmk__warn_once(wo_flag, fmt...)
#define pcmk__order_resource_actions(first_rsc, first_task, then_rsc, then_task, flags)
pcmk_resource_t * primary
int crm_str_to_boolean(const char *s, int *ret)
#define PCMK_XA_NODE_ATTRIBUTE
Cluster status and scheduling.
#define PCMK__ROLE_UNKNOWN
#define PCMK_ROLE_STARTED
G_GNUC_INTERNAL GHashTable * pcmk__copy_node_table(GHashTable *nodes)
pcmk_action_t * find_first_action(const GList *input, const char *uuid, const char *task, const pcmk_node_t *on_node)
pcmk_scheduler_t * scheduler
GList * pcmk__this_with_colocations(const pcmk_resource_t *rsc)
#define PCMK_XE_RESOURCE_SET
GList * colocation_constraints
void pcmk__new_colocation(const char *id, const char *node_attr, int score, pcmk_resource_t *dependent, pcmk_resource_t *primary, const char *dependent_role, const char *primary_role, uint32_t flags)
pcmk_node_t * allocated_to
#define PCMK_ACTION_PROMOTE
pcmk_resource_t * dependent
#define pe__show_node_scores(level, rsc, text, nodes, scheduler)
enum pe_action_flags flags
GList * placement_constraints
const char * node_attribute
#define PCMK_XA_SYMMETRICAL
#define crm_log_xml_trace(xml, text)
void pcmk__add_with_this_list(GList **list, GList *addition, const pcmk_resource_t *rsc)
Resource role is unknown.
void pcmk__add_dependent_scores(gpointer data, gpointer user_data)
Location constraint object.
pcmk_resource_t * find_clone_instance(const pcmk_resource_t *rsc, const char *sub_id)
#define pcmk__assert_alloc(nmemb, size)
xmlNode * pcmk__xe_next_same(const xmlNode *node)
#define PCMK_XA_SEQUENTIAL
G_GNUC_INTERNAL xmlNode * pcmk__expand_tags_in_sets(xmlNode *xml_obj, const pcmk_scheduler_t *scheduler)
#define crm_info(fmt, args...)
#define pcmk__clear_rsc_flags(resource, flags_to_clear)
GList * pcmk__with_this_colocations(const pcmk_resource_t *rsc)
#define PCMK_SCORE_INFINITY
Integer score to use to represent "infinity".
GHashTable * allowed_nodes