*/
create_color(GListPtr *colors, resource_t *resource, GListPtr resources){	color_t *new_color = NULL;		crm_trace("Creating color");	if(colors != NULL && g_list_length(*colors) >= max_valid_nodes) {		crm_warn("Created %d colors already", max_valid_nodes);		return NULL;	}	new_color = crm_malloc(sizeof(color_t));	new_color->id = color_id++;	new_color->local_weight = 1.0;	crm_trace("Creating color details");	new_color->details = crm_malloc(sizeof(struct color_shared_s));	new_color->details->id               = new_color->id;	new_color->details->highest_priority = -1;	new_color->details->chosen_node      = NULL;	new_color->details->candidate_nodes  = NULL;	if(resource != NULL) {		crm_trace("populating node list");		new_color->details->highest_priority = resource->priority;		new_color->details->candidate_nodes  =			node_list_dup(resource->allowed_nodes, TRUE);	}		crm_debug_action(print_color("Created color", new_color, TRUE));	if(colors != NULL) {		*colors = g_list_append(*colors, new_color);      	}		if(resources != NULL) {		/* Add any new color to the list of candidate_colors for		 * resources that havent been decided yet 		 */		int lpc;		slist_iter(			rsc, resource_t, resources, lpc,			if(rsc->provisional && rsc->runnable) {				color_t *color_copy = (color_t *)					cl_malloc(sizeof(color_t));				color_copy->id      = new_color->id;				color_copy->details = new_color->details;				color_copy->local_weight = 1.0; 				rsc->candidate_colors =					g_list_append(rsc->candidate_colors,						       color_copy);			}			);	}		return new_color;}