slist_iter( child_rsc, resource_t, clone_data->child_list, lpc, color_t *child_color = NULL; if(lpc >= clone_data->active_clones) { crm_warn("Clone %s cannot be started", child_rsc->id); } child_color = child_rsc->fns->color(child_rsc, data_set); CRM_DEV_ASSERT(child_color != NULL); native_assign_color(rsc, child_color); 
clone_data->self->allowed_nodes = g_list_sort( clone_data->self->allowed_nodes, sort_node_weight);  slist_iter(a_node, node_t, clone_data->self->allowed_nodes, lpc, color_t *new_color = NULL; if(can_run_resources(a_node) == FALSE) { crm_debug("Node cant run resources: %s", a_node->details->uname); continue; } crm_debug_3("Processing node %s for: %s", a_node->details->uname, rsc->id);  new_color = create_color(data_set, NULL, NULL); new_color->details->candidate_nodes = g_list_append( NULL, node_copy(a_node));  slist_iter(child, resource_t, clone_data->child_list, lpc2, node_t *current = NULL; if(child->provisional == FALSE) { CRM_DEV_ASSERT(child->color != NULL); current = child->color->details->chosen_node; } else if(child->running_on != NULL) { current = child->running_on->data; }  if(current == NULL) { crm_debug("Not active: %s", child->id); continue;  } else if(current->details != a_node->details) { crm_debug_2("Wrong node: %s", child->id); continue;  } else if(child->provisional == FALSE) { /* make sure it shows up */ native_assign_color(child, new_color); crm_debug("Previously colored: %s", child->id);  continue;  } else if(g_list_length(child->running_on) != 1) { crm_debug("active != 1: %s", child->id);  continue;  } else if(new_color->details->num_resources >= local_node_max) { crm_warn("Node %s too full for: %s", a_node->details->uname, child->id); continue; }  native_assign_color(child, new_color);  ); native_assign_color(rsc, new_color); child_colors = g_list_append(child_colors, new_color); );   while(local_node_max > 1 && clone_data->max_nodes * (local_node_max -1) >= clone_data->clone_max) { local_node_max--; crm_debug("Dropped the effective value of clone_node_max to: %d", local_node_max); }  /* allocate the rest */ slist_iter(child, resource_t, clone_data->child_list, lpc2, if(child->provisional == FALSE) { continue; } crm_debug_2("Processing unalloc'd resource: %s", child->id); color_ptr = next_color( child_colors, color_ptr, local_node_max); if(color_ptr == NULL) { native_assign_color(child, data_set->no_color); } else { native_assign_color(child, color_ptr->data); } 
clone_color(resource_t *rsc, pe_working_set_t *data_set){	int lpc = 0, lpc2 = 0;	resource_t *child_0  = NULL;	resource_t *child_lh = NULL;	resource_t *child_rh = NULL;	clone_variant_data_t *clone_data = NULL;	get_clone_variant_data(clone_data, rsc);	if(clone_data->self->provisional == FALSE) {		return NULL;	}	child_0 = g_list_nth_data(clone_data->child_list, 0);	clone_data->max_nodes = rsc->fns->num_allowed_nodes(rsc);	/* generate up to max_nodes * clone_node_max constraints */	lpc = 0;	clone_data->active_clones = clone_data->max_nodes * clone_data->clone_max_node;	if(clone_data->active_clones > clone_data->clone_max) {		clone_data->active_clones = clone_data->clone_max;	}	crm_info("Distributing %d (of %d) %s clones over %d nodes",		 clone_data->active_clones, clone_data->clone_max,		 rsc->id, clone_data->max_nodes);	if(clone_data->self->is_managed) {			for(; lpc < clone_data->active_clones && lpc < clone_data->max_nodes; lpc++) {			child_lh = g_list_nth_data(clone_data->child_list, lpc);			for(lpc2 = lpc + 1; lpc2 < clone_data->active_clones; lpc2++) {				child_rh = g_list_nth_data(clone_data->child_list,lpc2);								if(lpc2 < clone_data->max_nodes) {					crm_debug_2("Clone %d will not run with %d",						    lpc, lpc2);					rsc_colocation_new(						"__clone_internal_must_not__",						pecs_must_not, child_lh, child_rh, NULL, NULL);									} else if((lpc2 % clone_data->max_nodes) == lpc) {					crm_debug_2("Clone %d can run with %d",						    lpc, lpc2);					rsc_colocation_new(						"__clone_internal_must__",						pecs_must, child_lh, child_rh, NULL, NULL);				}			}			for(; lpc2 < clone_data->clone_max; lpc2++) {				child_rh = g_list_nth_data(clone_data->child_list,lpc2);				crm_debug_2("Unrunnable: Clone %d will not run with %d",					    lpc2, lpc);				rsc_colocation_new("__clone_internal_must_not__",						   pecs_must_not, child_lh, child_rh, NULL, NULL);			}					}	}	slist_iter(		child_rsc, resource_t, clone_data->child_list, lpc,		color_t *child_color = NULL;		if(lpc >= clone_data->active_clones) {			crm_warn("Clone %s cannot be started", child_rsc->id);		}		child_color = child_rsc->fns->color(child_rsc, data_set);		CRM_DEV_ASSERT(child_color != NULL);		native_assign_color(rsc, child_color);		);	clone_data->self->provisional = FALSE;	return NULL;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/599526e9a1218642926dbe435ffc748c2bdea1e5/incarnation.c/clean/crm/pengine/incarnation.c