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

Function find_rsc_list

pengine/allocate.c:431–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431static GListPtr
432find_rsc_list(GListPtr result, resource_t * rsc, const char *id, gboolean renamed_clones,
433 gboolean partial, pe_working_set_t * data_set)
434{
435 GListPtr gIter = NULL;
436 gboolean match = FALSE;
437
438 if (id == NULL) {
439 return NULL;
440
441 } else if (rsc == NULL && data_set) {
442
443 for (gIter = data_set->resources; gIter != NULL; gIter = gIter->next) {
444 resource_t *child = (resource_t *) gIter->data;
445
446 result = find_rsc_list(result, child, id, renamed_clones, partial, NULL);
447 }
448
449 return result;
450
451 } else if (rsc == NULL) {
452 return NULL;
453 }
454
455 if (partial) {
456 if (strstr(rsc->id, id)) {
457 match = TRUE;
458
459 } else if (renamed_clones && rsc->clone_name && strstr(rsc->clone_name, id)) {
460 match = TRUE;
461 }
462
463 } else {
464 if (strcmp(rsc->id, id) == 0) {
465 match = TRUE;
466
467 } else if (renamed_clones && rsc->clone_name && strcmp(rsc->clone_name, id) == 0) {
468 match = TRUE;
469 }
470 }
471
472 if (match) {
473 result = g_list_prepend(result, rsc);
474 }
475
476 if (rsc->children) {
477 gIter = rsc->children;
478 for (; gIter != NULL; gIter = gIter->next) {
479 resource_t *child = (resource_t *) gIter->data;
480
481 result = find_rsc_list(result, child, id, renamed_clones, partial, NULL);
482 }
483 }
484
485 return result;
486}
487
488static void

Callers 1

check_actionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected