| 2715 | } |
| 2716 | |
| 2717 | static gboolean |
| 2718 | at_stack_bottom(resource_t * rsc) |
| 2719 | { |
| 2720 | char *key = NULL; |
| 2721 | action_t *start = NULL; |
| 2722 | action_t *other = NULL; |
| 2723 | int mode = stack_stable; |
| 2724 | GListPtr action_list = NULL; |
| 2725 | GListPtr gIter = NULL; |
| 2726 | |
| 2727 | key = start_key(rsc); |
| 2728 | action_list = find_actions(rsc->actions, key, NULL); |
| 2729 | free(key); |
| 2730 | |
| 2731 | pe_rsc_trace(rsc, "%s: processing", rsc->id); |
| 2732 | CRM_CHECK(action_list != NULL, return FALSE); |
| 2733 | |
| 2734 | start = action_list->data; |
| 2735 | g_list_free(action_list); |
| 2736 | |
| 2737 | for (gIter = rsc->rsc_cons; gIter != NULL; gIter = gIter->next) { |
| 2738 | rsc_colocation_t *constraint = (rsc_colocation_t *) gIter->data; |
| 2739 | resource_t *target = constraint->rsc_rh; |
| 2740 | |
| 2741 | pe_rsc_trace(rsc, "Checking %s: %s == %s (%d)", constraint->id, rsc->id, target->id, |
| 2742 | constraint->score); |
| 2743 | if (constraint->score > 0) { |
| 2744 | mode |= check_stack_element(rsc, target, "coloc"); |
| 2745 | if (mode & stack_middle) { |
| 2746 | return FALSE; |
| 2747 | |
| 2748 | } else if ((mode & stack_stopping) && (mode & stack_starting)) { |
| 2749 | crm_notice("Cannot migrate %s due to colocation activity (last was %s)", |
| 2750 | rsc->id, target->id); |
| 2751 | return FALSE; |
| 2752 | } |
| 2753 | } |
| 2754 | } |
| 2755 | |
| 2756 | for (gIter = start->actions_before; gIter != NULL; gIter = gIter->next) { |
| 2757 | action_wrapper_t *other_w = (action_wrapper_t *) gIter->data; |
| 2758 | |
| 2759 | other = other_w->action; |
| 2760 | |
| 2761 | if (other_w->type & pe_order_serialize_only) { |
| 2762 | pe_rsc_trace(rsc, "%s: depends on %s (serialize ordering)", rsc->id, other->uuid); |
| 2763 | continue; |
| 2764 | } |
| 2765 | |
| 2766 | pe_rsc_trace(rsc, "%s: Checking %s ordering", rsc->id, other->uuid); |
| 2767 | |
| 2768 | if (is_set(other->flags, pe_action_optional) == FALSE) { |
| 2769 | mode |= check_stack_element(rsc, other->rsc, "order"); |
| 2770 | if (mode & stack_middle) { |
| 2771 | return FALSE; |
| 2772 | |
| 2773 | } else if ((mode & stack_stopping) && (mode & stack_starting)) { |
| 2774 | crm_notice("Cannot migrate %s due to ordering activity (last was %s)", |
no test coverage detected