| 1423 | } |
| 1424 | |
| 1425 | gboolean |
| 1426 | order_actions(action_t * lh_action, action_t * rh_action, enum pe_ordering order) |
| 1427 | { |
| 1428 | GListPtr gIter = NULL; |
| 1429 | action_wrapper_t *wrapper = NULL; |
| 1430 | GListPtr list = NULL; |
| 1431 | |
| 1432 | if (order == pe_order_none) { |
| 1433 | return FALSE; |
| 1434 | } |
| 1435 | |
| 1436 | if (lh_action == NULL || rh_action == NULL) { |
| 1437 | return FALSE; |
| 1438 | } |
| 1439 | |
| 1440 | crm_trace("Ordering Action %s before %s", lh_action->uuid, rh_action->uuid); |
| 1441 | |
| 1442 | /* Filter dups, otherwise update_action_states() has too much work to do */ |
| 1443 | gIter = lh_action->actions_after; |
| 1444 | for (; gIter != NULL; gIter = gIter->next) { |
| 1445 | action_wrapper_t *after = (action_wrapper_t *) gIter->data; |
| 1446 | |
| 1447 | if (after->action == rh_action && (after->type & order)) { |
| 1448 | return FALSE; |
| 1449 | } |
| 1450 | } |
| 1451 | |
| 1452 | wrapper = calloc(1, sizeof(action_wrapper_t)); |
| 1453 | wrapper->action = rh_action; |
| 1454 | wrapper->type = order; |
| 1455 | |
| 1456 | list = lh_action->actions_after; |
| 1457 | list = g_list_prepend(list, wrapper); |
| 1458 | lh_action->actions_after = list; |
| 1459 | |
| 1460 | wrapper = NULL; |
| 1461 | |
| 1462 | /* order |= pe_order_implies_then; */ |
| 1463 | /* order ^= pe_order_implies_then; */ |
| 1464 | |
| 1465 | wrapper = calloc(1, sizeof(action_wrapper_t)); |
| 1466 | wrapper->action = lh_action; |
| 1467 | wrapper->type = order; |
| 1468 | list = rh_action->actions_before; |
| 1469 | list = g_list_prepend(list, wrapper); |
| 1470 | rh_action->actions_before = list; |
| 1471 | return TRUE; |
| 1472 | } |
| 1473 | |
| 1474 | action_t * |
| 1475 | get_pseudo_op(const char *name, pe_working_set_t * data_set) |
no outgoing calls
no test coverage detected