Refactor: libpacemaker: Pass target_rsc to add_colocated_node_scores()
Nothing uses this yet.
Pass the resource on whose behalf we're updating the nodes table. We
will use this for attribute lookups.
The nodes argument is almost completely redundant now. It would be
nice to drop it. As before, cmp_resources() complicates things. So does
the group implementation -- it updates only the last member for
cmp_resources() (or the first member for other callers), and does not
update the group itself. It seems hacky to add special handling in
cmp_resources() for groups that's aware of the logic inside
pcmk__group_add_colocated_node_scores(). (Hard to say if that's hackier
than the current approach.)
The only elegant approach that comes to mind for dropping nodes is to:
- make a recursive copy of the allowed nodes tables for resource1 and resource2 in cmp_resources()
- pass in the same resource as both source_rsc and target_rsc, so that the resource's scratch node table is updated
- return the node table we want as the return value of add_colocated_node_scores(), so that we get the correct table for groups without having to grab it explicitly from the last member in the caller
- save the returned table
- restore the backed-up node tables
However, it's wasteful to copy every descendant's node table just to
save the table from the last member of a group.
Ref T672
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>