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

Function group_rsc_colocation_rh

pengine/group.c:343–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343void
344group_rsc_colocation_rh(resource_t * rsc_lh, resource_t * rsc_rh, rsc_colocation_t * constraint)
345{
346 GListPtr gIter = rsc_rh->children;
347 group_variant_data_t *group_data = NULL;
348
349 get_group_variant_data(group_data, rsc_rh);
350 CRM_CHECK(rsc_lh->variant == pe_native, return);
351
352 pe_rsc_trace(rsc_rh, "Processing RH of constraint %s", constraint->id);
353 print_resource(LOG_DEBUG_3, "LHS", rsc_lh, TRUE);
354
355 if (is_set(rsc_rh->flags, pe_rsc_provisional)) {
356 return;
357
358 } else if (group_data->colocated && group_data->first_child) {
359 if (constraint->score >= INFINITY) {
360 /* Ensure RHS is _fully_ up before can start LHS */
361 group_data->last_child->cmds->rsc_colocation_rh(rsc_lh, group_data->last_child,
362 constraint);
363 } else {
364 /* A partially active RHS is fine */
365 group_data->first_child->cmds->rsc_colocation_rh(rsc_lh, group_data->first_child,
366 constraint);
367 }
368
369 return;
370
371 } else if (constraint->score >= INFINITY) {
372 crm_config_err("%s: Cannot perform manditory colocation with"
373 " non-colocated group: %s", rsc_lh->id, rsc_rh->id);
374 return;
375 }
376
377 for (; gIter != NULL; gIter = gIter->next) {
378 resource_t *child_rsc = (resource_t *) gIter->data;
379
380 child_rsc->cmds->rsc_colocation_rh(rsc_lh, child_rsc, constraint);
381 }
382}
383
384enum pe_action_flags
385group_action_flags(action_t * action, node_t * node)

Callers

nothing calls this directly

Calls 2

print_resourceFunction · 0.85
is_setFunction · 0.85

Tested by

no test coverage detected