new_con->id = xmlGetProp(attr_exp, XML_ATTR_ID); new_con->rsc_lh = rsc_lh; new_con->weight = weight_f; new_con->modifier = a_modifier;  new_con->node_list_rh = match_attrs(attr_exp, node_list); 
new_con->id            = xmlGetProp(attr_exp, XML_ATTR_ID); new_con->rsc_lh        = rsc_lh; new_con->weight        = weight_f; new_con->modifier      = a_modifier; new_con->node_list_rh  = match_attrs(attr_exp, node_list); 
unpack_rsc_to_attr(xmlNodePtr xml_obj,		   GListPtr rsc_list,		   GListPtr node_list,		   GListPtr *node_constraints){/*<rsc_to_attr id="cons4" from="rsc2" weight="20.0" modifier="inc"><attr_expression id="attr_exp_1"/>  <node_match id="node_match_1" type="has_attr" target="cpu"/>  <node_match id="node_match_2" type="attr_value" target="kernel" value="2.6"/></attr_expression><attr_expression id="attr_exp_2"/>  <node_match id="node_match_3" type="has_attr" target="hdd"/>  <node_match id="node_match_4" type="attr_value" target="kernel" value="2.4"/></attr_expression>   Translation:       give any node a +ve weight of 20.0 to run rsc2 if:          attr "cpu" is set _and_ "kernel"="2.6", _or_	  attr "hdd" is set _and_ "kernel"="2.4"   Further translation:       2 constraints that give any node a +ve weight of 20.0 to run rsc2       cons1: attr "cpu" is set and "kernel"="2.6"       cons2: attr "hdd" is set and "kernel"="2.4"       */		xmlNodePtr attr_exp = xml_obj->children;	const char *id_lh   =  xmlGetProp(xml_obj, "from");	const char *mod     = xmlGetProp(xml_obj, "modifier");	const char *weight  = xmlGetProp(xml_obj, "weight");	const char *id      = xmlGetProp(attr_exp, XML_ATTR_ID);	float weight_f      = atof(weight);	enum con_modifier a_modifier = modifier_none;		resource_t *rsc_lh = pe_find_resource(rsc_list, id_lh);	if(rsc_lh == NULL) {		crm_err("No resource (con=%s, rsc=%s)",		       id, id_lh);		return FALSE;	}				if(safe_str_eq(mod, "set")){		a_modifier = set;	} else if(safe_str_eq(mod, "inc")){		a_modifier = inc;	} else if(safe_str_eq(mod, "dec")){		a_modifier = dec;	} else {		// error	}			if(attr_exp == NULL) {		crm_err("no attrs for constraint %s", id);	}		while(attr_exp != NULL) {		rsc_to_node_t *new_con = crm_malloc(sizeof(rsc_to_node_t));		new_con->id = xmlGetProp(attr_exp, XML_ATTR_ID);		new_con->rsc_lh = rsc_lh;		new_con->weight = weight_f;		new_con->modifier = a_modifier;		new_con->node_list_rh = match_attrs(attr_exp, node_list);				if(new_con->node_list_rh == NULL) {			crm_warn("No matching nodes for constraint  %s (%s)",				 xmlGetProp(attr_exp, XML_NVPAIR_ATTR_NAME),				 attr_exp->name);		}		crm_debug_action(print_rsc_to_node("Added", new_con, FALSE));		*node_constraints = g_list_append(*node_constraints, new_con);		/* dont add it to the resource,		 *  the information is in the resouce's node list		 */		attr_exp = attr_exp->next;	}	return TRUE;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/a31099ff591feabcdecbed51debb86941e5029fa/unpack.c/clean/crm/pengine/unpack.c