new_cons->node_rh = pe_find_node(node_list, new_cons->rsc_lh, node_id); 
new_cons->node_rh = pe_find_node(new_cons->rsc_lh->allowed_nodes, node_id); 
unpack_status(xmlNodePtr status){	while(status != NULL) {		const char *id = xmlGetProp(status, "id");		const char *state = xmlGetProp(status, "state");		const char *exp_state = xmlGetProp(status, "exp_state");		xmlNodePtr lrm_state = find_xml_node(status, "lrm");		lrm_state = find_xml_node(lrm_state, "lrm_resource");		lrm_state = find_xml_node(lrm_state, "rsc_state");		if(id == NULL) {			// error			continue;		}		if(safe_str_eq(exp_state, "active")		   && safe_str_eq(state, "active")) {			// process resource, make +ve preference			while(lrm_state != NULL) {				const char *rsc_id = xmlGetProp(lrm_state, "rsc_id");				const char *node_id = xmlGetProp(lrm_state, "node_id");				const char *rsc_state = xmlGetProp(lrm_state, "rsc_state");				if((safe_str_eq(rsc_state, "starting"))				   || (safe_str_eq(rsc_state, "started"))) {					rsc_constraint_t *new_cons = cl_malloc(sizeof(rsc_constraint_t));					new_cons->id = cl_strdup(""); // genereate one					new_cons->rsc_lh = pe_find_resource(rsc_list, rsc_id);					new_cons->type = rsc_to_node;					new_cons->weight = 100.0;					new_cons->node_rh = pe_find_node(node_list, new_cons->rsc_lh, node_id);					new_cons->modifier = inc;	 					g_slist_append(cons_list, new_cons);				} else if(safe_str_eq(rsc_state, "stop_fail")) {					// do soemthing				} // else no preference				lrm_state = lrm_state->next;			}		} else {			// remove node from contention			node_t *node = NULL;			int lpc = 0;			for(; lpc < g_slist_length(node_list); lpc++) {			  node_t *node = (node_t*)g_slist_nth_data(node_list, lpc);				if(safe_str_eq(node->id, id)){					node->weight = -1;					node->fixed = TRUE;				}			}      			if(safe_str_eq(exp_state, "down") 			   && safe_str_eq(state, "shutdown")) {				// create shutdown req			} else if(safe_str_eq(exp_state, "active")				  && safe_str_neq(state, "active")) {				// create stonith				// mark unclean				// remove any running resources from being allocated			}      			if(safe_str_eq(state, "unclean")) {				g_slist_append(stonith_list, node);			}		}		status = status->next;	}	g_slist_sort(cons_list, sort_cons_strength);	return TRUE;	}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/db8433868c8c969b4872da3b0ab348b28883713b/pengine.c/clean/crm/pengine/pengine.c