MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / clone_action_flags

Function clone_action_flags

pengine/clone.c:1127–1181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127enum pe_action_flags
1128clone_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
1183static enum pe_graph_flags
1184clone_update_actions_interleave(action_t * first, action_t * then, node_t * node,

Callers

nothing calls this directly

Calls 5

clone_child_actionFunction · 0.85
task2textFunction · 0.85
find_first_actionFunction · 0.85
is_setFunction · 0.85
crm_clear_bitFunction · 0.85

Tested by

no test coverage detected