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

Function rsc_known_on

pengine/clone.c:1400–1439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1398}
1399
1400node_t *
1401rsc_known_on(resource_t * rsc, GListPtr * list)
1402{
1403 GListPtr gIter = NULL;
1404 node_t *one = NULL;
1405 GListPtr result = NULL;
1406
1407 if (rsc->children) {
1408
1409 gIter = rsc->children;
1410 for (; gIter != NULL; gIter = gIter->next) {
1411 resource_t *child = (resource_t *) gIter->data;
1412
1413 rsc_known_on(child, &result);
1414 }
1415
1416 } else if (rsc->known_on) {
1417 result = g_hash_table_get_values(rsc->known_on);
1418 }
1419
1420 if (result && g_list_length(result) == 1) {
1421 one = g_list_nth_data(result, 0);
1422 }
1423
1424 if (list) {
1425 GListPtr gIter = NULL;
1426
1427 gIter = result;
1428 for (; gIter != NULL; gIter = gIter->next) {
1429 node_t *node = (node_t *) gIter->data;
1430
1431 if (*list == NULL || pe_find_node_id(*list, node->details->id) == NULL) {
1432 *list = g_list_prepend(*list, node);
1433 }
1434 }
1435 }
1436
1437 g_list_free(result);
1438 return one;
1439}
1440
1441static resource_t *
1442find_instance_on(resource_t * rsc, node_t * node)

Callers 1

find_instance_onFunction · 0.85

Calls 2

g_hash_table_get_valuesFunction · 0.85
pe_find_node_idFunction · 0.85

Tested by

no test coverage detected