| 1125 | } |
| 1126 | |
| 1127 | enum pe_action_flags |
| 1128 | clone_action_flags(action_t * action, node_t * node) |
| 1129 | { |
| 1130 | GListPtr gIter = NULL; |
| 1131 | gboolean any_runnable = FALSE; |
| 1132 | gboolean check_runnable = TRUE; |
| 1133 | enum action_tasks task = clone_child_action(action); |
| 1134 | enum pe_action_flags flags = (pe_action_optional | pe_action_runnable | pe_action_pseudo); |
| 1135 | const char *task_s = task2text(task); |
| 1136 | |
| 1137 | gIter = action->rsc->children; |
| 1138 | for (; gIter != NULL; gIter = gIter->next) { |
| 1139 | action_t *child_action = NULL; |
| 1140 | resource_t *child = (resource_t *) gIter->data; |
| 1141 | |
| 1142 | child_action = |
| 1143 | find_first_action(child->actions, NULL, task_s, child->children ? NULL : node); |
| 1144 | pe_rsc_trace(child, "Checking for %s in %s on %s", task_s, child->id, |
| 1145 | node ? node->details->uname : "none"); |
| 1146 | if (child_action) { |
| 1147 | enum pe_action_flags child_flags = child->cmds->action_flags(child_action, node); |
| 1148 | |
| 1149 | if (is_set(flags, pe_action_optional) |
| 1150 | && is_set(child_flags, pe_action_optional) == FALSE) { |
| 1151 | pe_rsc_trace(child, "%s is manditory because of %s", action->uuid, child_action->uuid); |
| 1152 | flags = crm_clear_bit(__FUNCTION__, action->rsc->id, flags, pe_action_optional); |
| 1153 | pe_clear_action_bit(action, pe_action_optional); |
| 1154 | } |
| 1155 | if (is_set(child_flags, pe_action_runnable)) { |
| 1156 | any_runnable = TRUE; |
| 1157 | } |
| 1158 | |
| 1159 | } else { |
| 1160 | |
| 1161 | GListPtr gIter2 = child->actions; |
| 1162 | |
| 1163 | for (; gIter2 != NULL; gIter2 = gIter2->next) { |
| 1164 | action_t *op = (action_t *) gIter2->data; |
| 1165 | |
| 1166 | pe_rsc_trace(child, "%s on %s (%s)", op->uuid, op->node ? op->node->details->uname : "none", |
| 1167 | op->task); |
| 1168 | } |
| 1169 | } |
| 1170 | } |
| 1171 | |
| 1172 | if (check_runnable && any_runnable == FALSE) { |
| 1173 | pe_rsc_trace(action->rsc, "%s is not runnable because no children are", action->uuid); |
| 1174 | flags = crm_clear_bit(__FUNCTION__, action->rsc->id, flags, pe_action_runnable); |
| 1175 | if (node == NULL) { |
| 1176 | pe_clear_action_bit(action, pe_action_runnable); |
| 1177 | } |
| 1178 | } |
| 1179 | |
| 1180 | return flags; |
| 1181 | } |
| 1182 | |
| 1183 | static enum pe_graph_flags |
| 1184 | clone_update_actions_interleave(action_t * first, action_t * then, node_t * node, |
nothing calls this directly
no test coverage detected