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

Function common_update_score

lib/pengine/complex.c:623–643  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621}
622
623void
624common_update_score(resource_t * rsc, const char *id, int score)
625{
626 node_t *node = NULL;
627
628 node = pe_hash_table_lookup(rsc->allowed_nodes, id);
629 if (node != NULL) {
630 pe_rsc_trace(rsc, "Updating score for %s on %s: %d + %d", rsc->id, id, node->weight, score);
631 node->weight = merge_weights(node->weight, score);
632 }
633
634 if (rsc->children) {
635 GListPtr gIter = rsc->children;
636
637 for (; gIter != NULL; gIter = gIter->next) {
638 resource_t *child_rsc = (resource_t *) gIter->data;
639
640 common_update_score(child_rsc, id, score);
641 }
642 }
643}
644
645resource_t *
646uber_parent(resource_t * rsc)

Callers 1

can_run_instanceFunction · 0.85

Calls 2

pe_hash_table_lookupFunction · 0.85
merge_weightsFunction · 0.85

Tested by

no test coverage detected