| 452 | } |
| 453 | |
| 454 | static void |
| 455 | append_parent_colocation(resource_t * rsc, resource_t * child, gboolean all) |
| 456 | { |
| 457 | |
| 458 | GListPtr gIter = NULL; |
| 459 | |
| 460 | gIter = rsc->rsc_cons; |
| 461 | for (; gIter != NULL; gIter = gIter->next) { |
| 462 | rsc_colocation_t *cons = (rsc_colocation_t *) gIter->data; |
| 463 | |
| 464 | if (all || cons->score < 0 || cons->score == INFINITY) { |
| 465 | child->rsc_cons = g_list_prepend(child->rsc_cons, cons); |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | gIter = rsc->rsc_cons_lhs; |
| 470 | for (; gIter != NULL; gIter = gIter->next) { |
| 471 | rsc_colocation_t *cons = (rsc_colocation_t *) gIter->data; |
| 472 | |
| 473 | if (all || cons->score < 0) { |
| 474 | child->rsc_cons_lhs = g_list_prepend(child->rsc_cons_lhs, cons); |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | node_t * |
| 480 | clone_color(resource_t * rsc, node_t * prefer, pe_working_set_t * data_set) |