| 949 | } |
| 950 | |
| 951 | resource_t * |
| 952 | find_compatible_child(resource_t * local_child, resource_t * rsc, enum rsc_role_e filter, |
| 953 | gboolean current) |
| 954 | { |
| 955 | resource_t *pair = NULL; |
| 956 | GListPtr gIter = NULL; |
| 957 | GListPtr scratch = NULL; |
| 958 | node_t *local_node = NULL; |
| 959 | |
| 960 | local_node = local_child->fns->location(local_child, NULL, current); |
| 961 | if (local_node) { |
| 962 | return find_compatible_child_by_node(local_child, local_node, rsc, filter, current); |
| 963 | } |
| 964 | |
| 965 | scratch = g_hash_table_get_values(local_child->allowed_nodes); |
| 966 | scratch = g_list_sort_with_data(scratch, sort_node_weight, NULL); |
| 967 | |
| 968 | gIter = scratch; |
| 969 | for (; gIter != NULL; gIter = gIter->next) { |
| 970 | node_t *node = (node_t *) gIter->data; |
| 971 | |
| 972 | pair = find_compatible_child_by_node(local_child, node, rsc, filter, current); |
| 973 | if (pair) { |
| 974 | goto done; |
| 975 | } |
| 976 | } |
| 977 | |
| 978 | pe_rsc_debug(rsc, "Can't pair %s with %s", local_child->id, rsc->id); |
| 979 | done: |
| 980 | g_list_free(scratch); |
| 981 | return pair; |
| 982 | } |
| 983 | |
| 984 | void |
| 985 | clone_rsc_colocation_lh(resource_t * rsc_lh, resource_t * rsc_rh, rsc_colocation_t * constraint) |
no test coverage detected