cons_list = g_slist_insert_sorted(cons_list, inverted_con, sort_cons_strength); cons_list = g_slist_insert_sorted(cons_list, new_con, sort_cons_strength);
rsc_cons_list = g_slist_insert_sorted(rsc_cons_list, inverted_con, sort_cons_strength); rsc_cons_list = g_slist_insert_sorted(rsc_cons_list, new_con, sort_cons_strength);
unpack_rsc_to_rsc(xmlNodePtr xml_obj){	rsc_constraint_t *new_con = cl_malloc(sizeof(rsc_constraint_t));	rsc_constraint_t *inverted_con = NULL;	const char *id_lh =  xmlGetProp(xml_obj, "from");	const char *id =  xmlGetProp(xml_obj, "id");	resource_t *rsc_lh = pe_find_resource(rsc_list, id_lh);	if(rsc_lh == NULL) {		cl_log(LOG_ERR, "No resource (con=%s, rsc=%s)",		       id, id_lh);		return FALSE;	}	new_con->id = cl_strdup(id);	new_con->rsc_lh = rsc_lh;				new_con->type = rsc_to_rsc;		const char *strength = xmlGetProp(xml_obj, "strength");	if(safe_str_eq(strength, "must")) {		new_con->strength = must;			} else if(safe_str_eq(strength, "should")) {		new_con->strength = should;			} else if(safe_str_eq(strength, "should_not")) {		new_con->strength = should_not;			} else if(safe_str_eq(strength, "must_not")) {		new_con->strength = must_not;	} else {		// error	}		const char *type = xmlGetProp(xml_obj, "type");	if(safe_str_eq(type, "ordering")) {		new_con->is_placement = FALSE;			} else if (safe_str_eq(type, "placement")) {		new_con->is_placement = TRUE;			} else {		// error	}		new_con->node_list_rh = NULL;	const char *id_rh = xmlGetProp(xml_obj, "to");	resource_t *rsc_rh = pe_find_resource(rsc_list, id_rh);	if(rsc_rh == NULL) {		cl_log(LOG_ERR, "No rh resource found with id %s", id_rh);		return FALSE;	}	new_con->rsc_rh = rsc_rh;		inverted_con = invert_constraint(new_con);	cons_list = g_slist_insert_sorted(cons_list, inverted_con, sort_cons_strength);	cons_list = g_slist_insert_sorted(cons_list, new_con, sort_cons_strength);	return TRUE;}