 fragment = create_cib_fragment(NULL, NULL); cib = find_xml_node(fragment, XML_TAG_CIB, TRUE); 
migrate_resource(	const char *rsc_id,	const char *existing_node, const char *preferred_node,	cib_t *	cib_conn) {	enum cib_errors rc = cib_ok;	char *id = NULL;	crm_data_t *cib = NULL;	crm_data_t *rule = NULL;	crm_data_t *expr = NULL;	crm_data_t *constraints = NULL;	crm_data_t *fragment = NULL;	crm_data_t *can_run = NULL;	crm_data_t *dont_run = NULL;		constraints = get_object_root(XML_CIB_TAG_CONSTRAINTS, cib);		id = crm_concat("cli-prefer", rsc_id, '-');	can_run = create_xml_node(constraints, XML_CIB_TAG_CONSTRAINT);	crm_xml_add(can_run, XML_ATTR_ID, id);	crm_free(id);	id = crm_concat("cli-standby", rsc_id, '-');	dont_run = create_xml_node(constraints, XML_CIB_TAG_CONSTRAINT);	crm_xml_add(dont_run, XML_ATTR_ID, id);	crm_free(id);	if(existing_node == NULL) {		rc = cib_conn->cmds->delete(cib_conn, XML_CIB_TAG_CONSTRAINTS,					    dont_run, NULL, cib_sync_call);	} else {		rule = create_xml_node(dont_run, XML_TAG_RULE);		expr = create_xml_node(rule, XML_TAG_EXPRESSION);		id = crm_concat("cli-standby-rule", rsc_id, '-');		crm_xml_add(rule, XML_ATTR_ID, id);		crm_free(id);				crm_xml_add(rule, XML_RULE_ATTR_SCORE, MINUS_INFINITY_S);				id = crm_concat("cli-standby-expr", rsc_id, '-');		crm_xml_add(expr, XML_ATTR_ID, id);		crm_free(id);				crm_xml_add(expr, XML_EXPR_ATTR_ATTRIBUTE, "#uname");		crm_xml_add(expr, XML_EXPR_ATTR_OPERATION, "eq");		crm_xml_add(expr, XML_EXPR_ATTR_VALUE, existing_node);		crm_xml_add(expr, XML_EXPR_ATTR_TYPE, "string");	}		if(preferred_node == NULL) {		rc = cib_conn->cmds->delete(cib_conn, XML_CIB_TAG_CONSTRAINTS,					    can_run, NULL, cib_sync_call);	} else {		rule = create_xml_node(can_run, XML_TAG_RULE);		expr = create_xml_node(rule, XML_TAG_EXPRESSION);		id = crm_concat("cli-prefer-rule", rsc_id, '-');		crm_xml_add(rule, XML_ATTR_ID, id);		crm_free(id);		crm_xml_add(rule, XML_RULE_ATTR_SCORE, INFINITY_S);			id = crm_concat("cli-prefer-expr", rsc_id, '-');		crm_xml_add(expr, XML_ATTR_ID, id);		crm_free(id);		crm_xml_add(expr, XML_EXPR_ATTR_ATTRIBUTE, "#uname");		crm_xml_add(expr, XML_EXPR_ATTR_OPERATION, "eq");		crm_xml_add(expr, XML_EXPR_ATTR_VALUE, preferred_node);		crm_xml_add(expr, XML_EXPR_ATTR_TYPE, "string");	}	rc = cib_conn->cmds->delete(cib_conn, XML_CIB_TAG_CONSTRAINTS,				    fragment, NULL, cib_sync_call);	return rc;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/a2c2f3c7fdb87036a9a18d944eafbf5fbcbeb896/crm_resource.c/clean/crm/admin/crm_resource.c