| 1521 | extern gboolean update_action(action_t * action); |
| 1522 | |
| 1523 | gboolean |
| 1524 | stage7(pe_working_set_t * data_set) |
| 1525 | { |
| 1526 | GListPtr gIter = NULL; |
| 1527 | |
| 1528 | crm_trace("Applying ordering constraints"); |
| 1529 | |
| 1530 | /* Don't ask me why, but apparently they need to be processed in |
| 1531 | * the order they were created in... go figure |
| 1532 | * |
| 1533 | * Also g_list_prepend() has horrendous performance characteristics |
| 1534 | * So we need to use g_list_prepend() and then reverse the list here |
| 1535 | */ |
| 1536 | data_set->ordering_constraints = g_list_reverse(data_set->ordering_constraints); |
| 1537 | |
| 1538 | gIter = data_set->ordering_constraints; |
| 1539 | for (; gIter != NULL; gIter = gIter->next) { |
| 1540 | order_constraint_t *order = (order_constraint_t *) gIter->data; |
| 1541 | resource_t *rsc = order->lh_rsc; |
| 1542 | |
| 1543 | crm_trace("Applying ordering constraint: %d", order->id); |
| 1544 | |
| 1545 | if (rsc != NULL) { |
| 1546 | crm_trace("rsc_action-to-*"); |
| 1547 | rsc_order_first(rsc, order, data_set); |
| 1548 | continue; |
| 1549 | } |
| 1550 | |
| 1551 | rsc = order->rh_rsc; |
| 1552 | if (rsc != NULL) { |
| 1553 | crm_trace("action-to-rsc_action"); |
| 1554 | rsc_order_then(order->lh_action, rsc, order); |
| 1555 | |
| 1556 | } else { |
| 1557 | crm_trace("action-to-action"); |
| 1558 | order_actions(order->lh_action, order->rh_action, order->type); |
| 1559 | } |
| 1560 | } |
| 1561 | |
| 1562 | crm_trace("Updating %d actions", g_list_length(data_set->actions)); |
| 1563 | |
| 1564 | gIter = data_set->actions; |
| 1565 | for (; gIter != NULL; gIter = gIter->next) { |
| 1566 | action_t *action = (action_t *) gIter->data; |
| 1567 | |
| 1568 | update_action(action); |
| 1569 | } |
| 1570 | |
| 1571 | crm_trace("Processing migrations"); |
| 1572 | |
| 1573 | gIter = data_set->resources; |
| 1574 | for (; gIter != NULL; gIter = gIter->next) { |
| 1575 | resource_t *rsc = (resource_t *) gIter->data; |
| 1576 | |
| 1577 | rsc_migrate_reload(rsc, data_set); |
| 1578 | LogActions(rsc, data_set, FALSE); |
| 1579 | } |
| 1580 |
no test coverage detected