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

Function resource_location

lib/pengine/utils.c:1127–1160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1125}
1126
1127void
1128resource_location(resource_t * rsc, node_t * node, int score, const char *tag,
1129 pe_working_set_t * data_set)
1130{
1131 if (node != NULL) {
1132 resource_node_score(rsc, node, score, tag);
1133
1134 } else if (data_set != NULL) {
1135 GListPtr gIter = data_set->nodes;
1136
1137 for (; gIter != NULL; gIter = gIter->next) {
1138 node_t *node = (node_t *) gIter->data;
1139
1140 resource_node_score(rsc, node, score, tag);
1141 }
1142
1143 } else {
1144 GHashTableIter iter;
1145 node_t *node = NULL;
1146
1147 g_hash_table_iter_init(&iter, rsc->allowed_nodes);
1148 while (g_hash_table_iter_next(&iter, NULL, (void **)&node)) {
1149 resource_node_score(rsc, node, score, tag);
1150 }
1151 }
1152
1153 if (node == NULL && score == -INFINITY) {
1154 if (rsc->allocated_to) {
1155 crm_info("Deallocating %s from %s", rsc->id, rsc->allocated_to->details->uname);
1156 free(rsc->allocated_to);
1157 rsc->allocated_to = NULL;
1158 }
1159 }
1160}
1161
1162#define sort_return(an_int, why) do { \
1163 free(a_uuid); \

Callers 11

process_orphan_resourceFunction · 0.85
process_rsc_stateFunction · 0.85
unpack_rsc_opFunction · 0.85
common_unpackFunction · 0.85
native_add_runningFunction · 0.85
common_apply_stickinessFunction · 0.85
clone_colorFunction · 0.85
master_promotion_orderFunction · 0.85
native_choose_nodeFunction · 0.85
native_colorFunction · 0.85
rsc_ticket_constraintFunction · 0.85

Calls 3

resource_node_scoreFunction · 0.85
g_hash_table_iter_initFunction · 0.85
g_hash_table_iter_nextFunction · 0.85

Tested by

no test coverage detected