| 1100 | } |
| 1101 | |
| 1102 | static void |
| 1103 | resource_node_score(resource_t * rsc, node_t * node, int score, const char *tag) |
| 1104 | { |
| 1105 | node_t *match = NULL; |
| 1106 | |
| 1107 | if (rsc->children) { |
| 1108 | GListPtr gIter = rsc->children; |
| 1109 | |
| 1110 | for (; gIter != NULL; gIter = gIter->next) { |
| 1111 | resource_t *child_rsc = (resource_t *) gIter->data; |
| 1112 | |
| 1113 | resource_node_score(child_rsc, node, score, tag); |
| 1114 | } |
| 1115 | } |
| 1116 | |
| 1117 | pe_rsc_trace(rsc, "Setting %s for %s on %s: %d", tag, rsc->id, node->details->uname, score); |
| 1118 | match = pe_hash_table_lookup(rsc->allowed_nodes, node->details->id); |
| 1119 | if (match == NULL) { |
| 1120 | match = node_copy(node); |
| 1121 | match->weight = merge_weights(score, node->weight); |
| 1122 | g_hash_table_insert(rsc->allowed_nodes, (gpointer) match->details->id, match); |
| 1123 | } |
| 1124 | match->weight = merge_weights(match->weight, score); |
| 1125 | } |
| 1126 | |
| 1127 | void |
| 1128 | resource_location(resource_t * rsc, node_t * node, int score, const char *tag, |
no test coverage detected