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

Function node_hash_update_one

pengine/master.c:915–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

913}
914
915static void
916node_hash_update_one(GHashTable * hash, node_t * other, const char *attr, int score)
917{
918 GHashTableIter iter;
919 node_t *node = NULL;
920 const char *value = NULL;
921
922 if (other == NULL) {
923 return;
924
925 } else if (attr == NULL) {
926 attr = "#" XML_ATTR_UNAME;
927 }
928
929 value = g_hash_table_lookup(other->details->attrs, attr);
930 g_hash_table_iter_init(&iter, hash);
931 while (g_hash_table_iter_next(&iter, NULL, (void **)&node)) {
932 const char *tmp = g_hash_table_lookup(node->details->attrs, attr);
933
934 if (safe_str_eq(value, tmp)) {
935 crm_trace("%s: %d + %d", node->details->uname, node->weight, other->weight);
936 node->weight = merge_weights(node->weight, score);
937 }
938 }
939}
940
941void
942master_rsc_colocation_rh(resource_t * rsc_lh, resource_t * rsc_rh, rsc_colocation_t * constraint)

Callers 1

master_rsc_colocation_rhFunction · 0.85

Calls 3

g_hash_table_iter_initFunction · 0.85
g_hash_table_iter_nextFunction · 0.85
merge_weightsFunction · 0.85

Tested by

no test coverage detected