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

Function clone_create_actions

pengine/clone.c:781–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779}
780
781void
782clone_create_actions(resource_t * rsc, pe_working_set_t * data_set)
783{
784 gboolean child_active = FALSE;
785 gboolean child_starting = FALSE;
786 gboolean child_stopping = FALSE;
787
788 action_t *stop = NULL;
789 action_t *stopped = NULL;
790
791 action_t *start = NULL;
792 action_t *started = NULL;
793
794 GListPtr gIter = rsc->children;
795 clone_variant_data_t *clone_data = NULL;
796
797 get_clone_variant_data(clone_data, rsc);
798
799 pe_rsc_trace(rsc, "Creating actions for %s", rsc->id);
800
801 for (; gIter != NULL; gIter = gIter->next) {
802 resource_t *child_rsc = (resource_t *) gIter->data;
803
804 child_rsc->cmds->create_actions(child_rsc, data_set);
805 clone_update_pseudo_status(child_rsc, &child_stopping, &child_starting, &child_active);
806 }
807
808 /* start */
809 start = start_action(rsc, NULL, !child_starting);
810 started = custom_action(rsc, started_key(rsc),
811 RSC_STARTED, NULL, !child_starting, TRUE, data_set);
812
813 update_action_flags(start, pe_action_pseudo | pe_action_runnable);
814 update_action_flags(started, pe_action_pseudo);
815 started->priority = INFINITY;
816
817 if (child_active || child_starting) {
818 update_action_flags(started, pe_action_runnable);
819 }
820
821 child_ordering_constraints(rsc, data_set);
822 if (clone_data->start_notify == NULL) {
823 clone_data->start_notify =
824 create_notification_boundaries(rsc, RSC_START, start, started, data_set);
825 }
826
827 /* stop */
828 stop = stop_action(rsc, NULL, !child_stopping);
829 stopped = custom_action(rsc, stopped_key(rsc),
830 RSC_STOPPED, NULL, !child_stopping, TRUE, data_set);
831
832 stopped->priority = INFINITY;
833 update_action_flags(stop, pe_action_pseudo | pe_action_runnable);
834 update_action_flags(stopped, pe_action_pseudo | pe_action_runnable);
835 if (clone_data->stop_notify == NULL) {
836 clone_data->stop_notify =
837 create_notification_boundaries(rsc, RSC_STOP, stop, stopped, data_set);
838

Callers 1

master_create_actionsFunction · 0.85

Calls 6

custom_actionFunction · 0.85
update_action_flagsFunction · 0.85
order_actionsFunction · 0.85

Tested by

no test coverage detected