xmlSetProp(new_status, XML_CIB_ATTR_MAXINSTANCE, xmlGetProp(resource, XML_CIB_ATTR_MAXINSTANCE)); xmlSetProp(new_status, XML_CIB_ATTR_RESSTATUS, status);
set_xml_property_copy(new_status, XML_CIB_ATTR_MAXINSTANCE, xmlGetProp(resource, XML_CIB_ATTR_MAXINSTANCE)); set_xml_property_copy(new_status, XML_CIB_ATTR_RESSTATUS, status);
updateCibStatus(xmlNodePtr cib, const char *res_id, const char *instanceNum, const char *node_id, const char *status){    CRM_DEBUG4("Update: " XML_CIB_TAG_STATE " (%s:%s)@(%s).", res_id, instanceNum, node_id);    xmlNodePtr resource = findResource(cib, res_id);    if(resource != NULL)    {	CRM_DEBUG4("Attempting to set allocated " XML_CIB_TAG_NODE " for " XML_CIB_TAG_RESOURCE " (%s:%s) to (%s).", res_id, instanceNum, node_id);	xmlNodePtr node = findHaNode(cib, node_id);	if(node == NULL)	{	    cl_log(LOG_CRIT, XML_CIB_TAG_NODE " (%s) does not exist, cannot assign " XML_CIB_TAG_RESOURCE " (%s:%s) to it in the status list.",		   node_id,		   res_id,		   instanceNum);	    FNRET(-1);	}	/* this could probable be optimized to update the status entry directly instead of creating a new one and doing	 *   the update with that... but for now, lets make it work.	 */	cibStatus *new_status = newStatus(res_id, node_id, instanceNum);	xmlSetProp(new_status, XML_CIB_ATTR_MAXINSTANCE, xmlGetProp(resource, XML_CIB_ATTR_MAXINSTANCE));	xmlSetProp(new_status, XML_CIB_ATTR_RESSTATUS, status);	// TODO: set the source of the info	//new_status.source = "nodeX";	updateStatus(cib, new_status);    }    else    {	cl_log(LOG_CRIT, XML_CIB_TAG_RESOURCE " (%s) does not exist, cannot add it to the " XML_CIB_TAG_STATUS " list.", res_id);	FNRET(-2);    }    FNRET(0);}