| 1257 | } |
| 1258 | |
| 1259 | enum pe_graph_flags |
| 1260 | clone_update_actions(action_t * first, action_t * then, node_t * node, enum pe_action_flags flags, |
| 1261 | enum pe_action_flags filter, enum pe_ordering type) |
| 1262 | { |
| 1263 | const char *rsc = "none"; |
| 1264 | gboolean interleave = FALSE; |
| 1265 | enum pe_graph_flags changed = pe_graph_none; |
| 1266 | |
| 1267 | if (first->rsc != then->rsc |
| 1268 | && first->rsc && first->rsc->variant >= pe_clone |
| 1269 | && then->rsc && then->rsc->variant >= pe_clone) { |
| 1270 | clone_variant_data_t *clone_data = NULL; |
| 1271 | |
| 1272 | if (strstr(then->uuid, "_stop_0") || strstr(then->uuid, "_demote_0")) { |
| 1273 | get_clone_variant_data(clone_data, first->rsc); |
| 1274 | rsc = first->rsc->id; |
| 1275 | } else { |
| 1276 | get_clone_variant_data(clone_data, then->rsc); |
| 1277 | rsc = then->rsc->id; |
| 1278 | } |
| 1279 | interleave = clone_data->interleave; |
| 1280 | } |
| 1281 | |
| 1282 | crm_trace("Interleave %s -> %s: %s (based on %s)", |
| 1283 | first->uuid, then->uuid, interleave ? "yes" : "no", rsc); |
| 1284 | |
| 1285 | if (interleave) { |
| 1286 | changed = clone_update_actions_interleave(first, then, node, flags, filter, type); |
| 1287 | |
| 1288 | } else if (then->rsc) { |
| 1289 | GListPtr gIter = then->rsc->children; |
| 1290 | |
| 1291 | changed |= native_update_actions(first, then, node, flags, filter, type); |
| 1292 | |
| 1293 | for (; gIter != NULL; gIter = gIter->next) { |
| 1294 | resource_t *child = (resource_t *) gIter->data; |
| 1295 | action_t *child_action = find_first_action(child->actions, NULL, then->task, node); |
| 1296 | |
| 1297 | if (child_action) { |
| 1298 | enum pe_action_flags child_flags = child->cmds->action_flags(child_action, node); |
| 1299 | |
| 1300 | if (is_set(child_flags, pe_action_runnable)) { |
| 1301 | changed |= |
| 1302 | child->cmds->update_actions(first, child_action, node, flags, filter, type); |
| 1303 | } |
| 1304 | } |
| 1305 | } |
| 1306 | } |
| 1307 | |
| 1308 | return changed; |
| 1309 | } |
| 1310 | |
| 1311 | void |
| 1312 | clone_rsc_location(resource_t * rsc, rsc_to_node_t * constraint) |
nothing calls this directly
no test coverage detected