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

Function get_first_named_action

pengine/native.c:2783–2812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2781}
2782
2783static action_t *
2784get_first_named_action(resource_t *rsc, const char *action, gboolean only_valid, node_t *current)
2785{
2786 action_t *a = NULL;
2787 GListPtr action_list = NULL;
2788 char *key = generate_op_key(rsc->id, action, 0);
2789
2790 action_list = find_actions(rsc->actions, key, current);
2791
2792 if (action_list == NULL || action_list->data == NULL) {
2793 crm_trace("%s: no %s action", rsc->id, action);
2794 free(key);
2795 return NULL;
2796 }
2797
2798 a = action_list->data;
2799 g_list_free(action_list);
2800
2801 if(only_valid && is_set(a->flags, pe_action_pseudo)) {
2802 crm_trace("%s: pseudo", key);
2803 a = NULL;
2804
2805 } else if(only_valid && is_not_set(a->flags, pe_action_runnable)) {
2806 crm_trace("%s: runnable", key);
2807 a = NULL;
2808 }
2809
2810 free(key);
2811 return a;
2812}
2813
2814static void
2815MigrateRsc(resource_t * rsc, action_t *stop, action_t *start, pe_working_set_t * data_set, gboolean partial)

Callers 2

ReloadRscFunction · 0.85
rsc_migrate_reloadFunction · 0.85

Calls 4

generate_op_keyFunction · 0.85
find_actionsFunction · 0.85
is_setFunction · 0.85
is_not_setFunction · 0.85

Tested by

no test coverage detected