29 bool any_unmanaged =
false;
38 for (item = rsc->
rsc_cons; item != NULL; item = item->next) {
58 for (item = rsc->
children->next; item != NULL; item = item->next) {
61 for (GList *cons_iter = rsc->
rsc_cons; cons_iter != NULL;
62 cons_iter = cons_iter->next) {
80 for (item = rsc->
rsc_cons_lhs; item != NULL; item = item->next) {
108 pe_rsc_debug(rsc,
"Assignment dependency loop detected involving %s",
123 expand_group_colocations(rsc);
128 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
133 rsc->
id, member->
id);
135 if (first_assigned_node == NULL) {
136 first_assigned_node = node;
146 return first_assigned_node;
181 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
190 create_group_pseudo_op(rsc,
RSC_STOP);
219 member_internal_constraints(gpointer
data, gpointer user_data)
222 struct member_data *member_data = (
struct member_data *) user_data;
233 if (member_data->previous_member == NULL) {
235 if (member_data->ordered) {
240 }
else if (member_data->colocated) {
243 member, member_data->previous_member, NULL, NULL,
248 if (member_data->promotable) {
279 if (!member_data->ordered) {
284 if (member_data->promotable) {
292 }
else if (member_data->previous_member == NULL) {
294 if (member_data->promotable) {
305 if (member_data->promotable) {
311 member_data->previous_member,
318 if (member_data->ordered && (member_data->previous_member != NULL)
319 && (member_data->previous_member->running_on == NULL)
320 && (member_data->last_active != NULL)
321 && (member_data->last_active->running_on != NULL)) {
324 member_data->last_active = member;
327 member_data->previous_member = member;
339 struct member_data member_data = {
false, };
356 g_list_foreach(rsc->
children, member_internal_constraints, &member_data);
381 pe_rsc_trace(primary,
"Processing %s (group %s with %s) for dependent",
382 colocation->
id, dependent->
id, primary->
id);
393 "non-colocated group and %s",
394 dependent->
id, primary->
id);
399 for (GList *iter = dependent->
children; iter != NULL; iter = iter->next) {
424 "Processing colocation %s (%s with group %s) for primary",
425 colocation->
id, dependent->
id, primary->
id);
439 }
else if (primary->
children != NULL) {
446 if (member == NULL) {
456 " non-colocated group %s",
457 dependent->
id, primary->
id);
462 for (GList *iter = primary->
children; iter != NULL; iter = iter->next) {
487 CRM_ASSERT((dependent != NULL) && (primary != NULL)
488 && (colocation != NULL));
491 colocate_group_with(dependent, primary, colocation);
497 colocate_with_group(dependent, primary, colocation);
521 for (GList *iter =
action->rsc->children; iter != NULL; iter = iter->next) {
530 if (member_action != NULL) {
562 "%s is not runnable because %s will not %s",
597 uint32_t filter, uint32_t
type,
612 for (GList *iter = then->
rsc->
children; iter != NULL; iter = iter->next) {
618 if (member_action != NULL) {
638 GList *node_list_orig = NULL;
639 GList *node_list_copy = NULL;
640 bool reset_scores =
true;
642 CRM_ASSERT((rsc != NULL) && (location != NULL));
652 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
662 reset_scores =
false;
668 g_list_free_full(node_list_copy, free);
674 GList *colocated_rscs)
680 if (orig_rsc == NULL) {
685 || pe_rsc_is_clone(rsc->
parent)) {
689 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
707 return colocated_rscs;
714 GHashTable *utilization)
718 CRM_ASSERT((rsc != NULL) && (orig_rsc != NULL) && (utilization != NULL));
724 pe_rsc_trace(orig_rsc,
"%s: Adding group %s as colocated utilization",
725 orig_rsc->
id, rsc->
id);
727 || pe_rsc_is_clone(rsc->
parent)) {
729 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
733 && (g_list_find(all_rscs, member) == NULL)) {
744 && (g_list_find(all_rscs, member) == NULL)) {
758 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
GList * pcmk__copy_node_list(const GList *list, bool reset)
const char * task2text(enum action_tasks task)
#define pcmk__order_starts(rsc1, rsc2, flags)
#define pe_rsc_debug(rsc, fmt, args...)
#define pe__set_action_flags(action, flags_to_set)
G_GNUC_INTERNAL uint32_t pcmk__update_ordered_actions(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
#define pe__show_node_weights(level, rsc, text, nodes, data_set)
G_GNUC_INTERNAL GList * pcmk__colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
void pcmk__group_internal_constraints(pe_resource_t *rsc)
void(* internal_constraints)(pe_resource_t *rsc)
resource_alloc_functions_t * cmds
#define pcmk__order_stops(rsc1, rsc2, flags)
enum rsc_role_e next_role
pe_action_t * find_first_action(const GList *input, const char *uuid, const char *task, const pe_node_t *on_node)
#define pcmk__config_err(fmt...)
enum crm_ais_msg_types type
G_GNUC_INTERNAL void pcmk__add_with_this(pe_resource_t *rsc, pcmk__colocation_t *colocation)
void pcmk__group_apply_coloc_score(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
void pcmk__group_apply_location(pe_resource_t *rsc, pe__location_t *location)
G_GNUC_INTERNAL void pcmk__new_colocation(const char *id, const char *node_attr, int score, pe_resource_t *dependent, pe_resource_t *primary, const char *dependent_role, const char *primary_role, bool influence, pe_working_set_t *data_set)
#define pe__set_resource_flags(resource, flags_to_set)
pe_node_t *(* assign)(pe_resource_t *rsc, const pe_node_t *prefer)
enum pe_action_flags(* action_flags)(pe_action_t *action, const pe_node_t *node)
#define pe_rsc_provisional
void pcmk__group_create_actions(pe_resource_t *rsc)
#define XML_RSC_ATTR_PROMOTABLE
pe_resource_t * uber_parent(pe_resource_t *rsc)
GList * pcmk__group_colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
void pcmk__group_add_utilization(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
#define pe__clear_action_flags(action, flags_to_clear)
enum action_tasks get_complex_task(pe_resource_t *rsc, const char *name, gboolean allow_non_atomic)
GList *(* colocated_resources)(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define pe_rsc_promotable
pe_working_set_t * data_set
void(* create_actions)(pe_resource_t *rsc)
#define pe_rsc_allocating
enum pe_obj_types variant
void(* add_utilization)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define pcmk__order_resource_actions(first_rsc, first_task, then_rsc, then_task, flags)
void(* apply_coloc_score)(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
G_GNUC_INTERNAL void pcmk__apply_location(pe_resource_t *rsc, pe__location_t *constraint)
pe_resource_t * pe__last_group_member(const pe_resource_t *group)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
#define pe__clear_resource_flags(resource, flags_to_clear)
enum pe_action_flags pcmk__group_action_flags(pe_action_t *action, const pe_node_t *node)
pe_working_set_t * cluster
G_GNUC_INTERNAL void pcmk__add_this_with(pe_resource_t *rsc, pcmk__colocation_t *colocation)
pe_node_t * pcmk__group_assign(pe_resource_t *rsc, const pe_node_t *prefer)
gboolean crm_is_true(const char *s)
void pcmk__group_shutdown_lock(pe_resource_t *rsc)
void(* shutdown_lock)(pe_resource_t *rsc)
void(* apply_location)(pe_resource_t *rsc, pe__location_t *location)
#define pe_rsc_trace(rsc, fmt, args...)
#define pe__set_order_flags(order_flags, flags_to_set)
bool pe__group_flag_is_set(const pe_resource_t *group, uint32_t flags)
uint32_t(* update_ordered_actions)(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
uint32_t pcmk__group_update_ordered_actions(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, const pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
Create or update an action object.
#define pe_flag_show_scores
#define pe__clear_raw_action_flags(action_flags, action_name, flags_to_clear)
GHashTable * allowed_nodes