| 762 | } |
| 763 | |
| 764 | void |
| 765 | master_create_actions(resource_t * rsc, pe_working_set_t * data_set) |
| 766 | { |
| 767 | action_t *action = NULL; |
| 768 | GListPtr gIter = rsc->children; |
| 769 | action_t *action_complete = NULL; |
| 770 | gboolean any_promoting = FALSE; |
| 771 | gboolean any_demoting = FALSE; |
| 772 | resource_t *last_promote_rsc = NULL; |
| 773 | resource_t *last_demote_rsc = NULL; |
| 774 | |
| 775 | clone_variant_data_t *clone_data = NULL; |
| 776 | |
| 777 | get_clone_variant_data(clone_data, rsc); |
| 778 | |
| 779 | pe_rsc_debug(rsc, "Creating actions for %s", rsc->id); |
| 780 | |
| 781 | /* create actions as normal */ |
| 782 | clone_create_actions(rsc, data_set); |
| 783 | |
| 784 | for (; gIter != NULL; gIter = gIter->next) { |
| 785 | gboolean child_promoting = FALSE; |
| 786 | gboolean child_demoting = FALSE; |
| 787 | resource_t *child_rsc = (resource_t *) gIter->data; |
| 788 | |
| 789 | pe_rsc_trace(rsc, "Creating actions for %s", child_rsc->id); |
| 790 | child_rsc->cmds->create_actions(child_rsc, data_set); |
| 791 | master_update_pseudo_status(child_rsc, &child_demoting, &child_promoting); |
| 792 | |
| 793 | any_demoting = any_demoting || child_demoting; |
| 794 | any_promoting = any_promoting || child_promoting; |
| 795 | pe_rsc_trace(rsc, "Created actions for %s: %d %d", child_rsc->id, child_promoting, |
| 796 | child_demoting); |
| 797 | } |
| 798 | |
| 799 | /* promote */ |
| 800 | action = promote_action(rsc, NULL, !any_promoting); |
| 801 | action_complete = custom_action(rsc, promoted_key(rsc), |
| 802 | RSC_PROMOTED, NULL, !any_promoting, TRUE, data_set); |
| 803 | |
| 804 | action_complete->priority = INFINITY; |
| 805 | update_action_flags(action, pe_action_pseudo); |
| 806 | update_action_flags(action, pe_action_runnable); |
| 807 | update_action_flags(action_complete, pe_action_pseudo); |
| 808 | update_action_flags(action_complete, pe_action_runnable); |
| 809 | |
| 810 | if (clone_data->masters_allocated > 0) { |
| 811 | update_action_flags(action, pe_action_runnable); |
| 812 | update_action_flags(action_complete, pe_action_runnable); |
| 813 | } |
| 814 | |
| 815 | child_promoting_constraints(clone_data, pe_order_optional, |
| 816 | rsc, NULL, last_promote_rsc, data_set); |
| 817 | |
| 818 | if (clone_data->promote_notify == NULL) { |
| 819 | clone_data->promote_notify = |
| 820 | create_notification_boundaries(rsc, RSC_PROMOTE, action, action_complete, data_set); |
| 821 | } |
nothing calls this directly
no test coverage detected