chosen->details->num_resources += color->details->num_resources;  /* todo: update the old node for each resource to reflect its * new resource count */  
choose_node_from_list(color_t *color){	/*	  1. Sort by weight	  2. color.chosen_node = highest wieghted node 	  3. remove color.chosen_node from all other colors	*/	GListPtr nodes = color->details->candidate_nodes;	node_t *chosen = NULL;	nodes  = g_list_sort(nodes, sort_node_weight);	chosen = g_list_nth_data(nodes, 0);	color->details->chosen_node = NULL;	color->details->pending = FALSE;	if(chosen == NULL) {		crm_debug("Could not allocate a node for color %d", color->id);		return FALSE;	}		color->details->chosen_node = node_copy(chosen);	return TRUE;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/188523bacff290275fc3804c1c297b303e533178/stages.c/buggy/crm/pengine/stages.c