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

Function rsc_migrate_reload

pengine/native.c:3070–3125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3068}
3069
3070void
3071rsc_migrate_reload(resource_t * rsc, pe_working_set_t * data_set)
3072{
3073 GListPtr gIter = NULL;
3074 action_t *stop = NULL;
3075 action_t *start = NULL;
3076 gboolean partial = FALSE;
3077
3078 if (rsc->children) {
3079 for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
3080 resource_t *child_rsc = (resource_t *) gIter->data;
3081
3082 rsc_migrate_reload(child_rsc, data_set);
3083 }
3084 return;
3085
3086 } else if (rsc->variant > pe_native) {
3087 return;
3088 }
3089
3090 pe_rsc_trace(rsc, "Processing %s", rsc->id);
3091
3092 if (rsc->partial_migration_target) {
3093 start = get_first_named_action(rsc, RSC_START, TRUE, rsc->partial_migration_target);
3094 stop = get_first_named_action(rsc, RSC_STOP, TRUE, rsc->partial_migration_source);
3095 if (start && stop) {
3096 partial = TRUE;
3097 }
3098 }
3099
3100 pe_rsc_trace(rsc, "%s %s %p", rsc->id, partial?"partial":"full", stop);
3101
3102 if (!partial) {
3103 stop = get_first_named_action(rsc, RSC_STOP, TRUE, rsc->running_on ? rsc->running_on->data : NULL);
3104 start = get_first_named_action(rsc, RSC_START, TRUE, NULL);
3105 }
3106
3107 if (is_not_set(rsc->flags, pe_rsc_managed)
3108 || is_set(rsc->flags, pe_rsc_failed)
3109 || is_set(rsc->flags, pe_rsc_start_pending)
3110 || rsc->next_role < RSC_ROLE_STARTED
3111 || ((g_list_length(rsc->running_on) != 1) && !partial)) {
3112 pe_rsc_trace(rsc, "%s: general resource state: flags=0x%.16llx", rsc->id, rsc->flags);
3113 return;
3114 }
3115
3116 if(stop == NULL) {
3117 return;
3118
3119 } else if (is_set(stop->flags, pe_action_optional) && is_set(rsc->flags, pe_rsc_try_reload)) {
3120 ReloadRsc(rsc, stop, start, data_set);
3121
3122 } else if(is_not_set(stop->flags, pe_action_optional)) {
3123 MigrateRsc(rsc, stop, start, data_set, partial);
3124 }
3125}
3126
3127

Callers 1

stage7Function · 0.85

Calls 5

get_first_named_actionFunction · 0.85
is_not_setFunction · 0.85
is_setFunction · 0.85
ReloadRscFunction · 0.85
MigrateRscFunction · 0.85

Tested by

no test coverage detected