crm_debug("Added  <%s id=%s>",
crm_debug_2("Added  <%s id=%s>",
update_cib_object(crm_data_t *parent, crm_data_t *new_obj, gboolean force){	const char *replace = NULL;	const char *object_name = NULL;	char *object_id = NULL;	crm_data_t *equiv_node = NULL;	int result = cib_ok;		if(new_obj != NULL) {		object_name = crm_element_name(new_obj);		if(crm_element_value(new_obj, XML_ATTR_ID) != NULL){			object_id = crm_element_value_copy(new_obj,XML_ATTR_ID);		}	}	if(new_obj == NULL) {		result = cib_NOOBJECT;	} else if(parent == NULL) {		result = cib_NOPARENT;	} else if(object_id == NULL) {		/*  placeholder object */		equiv_node = find_xml_node(parent, object_name, FALSE);	} else {		equiv_node = find_entity(parent, object_name, object_id);	}#if INTERMEDIATE_NOTIFICATIONS	cib_pre_notify(CRM_OP_CIB_UPDATE, equiv_node, new_obj);#endif	if(result != cib_ok) {		; /* nothing */			} else if(equiv_node == NULL) {		crm_debug("No node to update, creating %s instead",			  crm_element_name(new_obj));		if(parent == NULL) {			crm_err("Failed to add <%s id=%s> (NULL parent)",				 object_name, object_id);			result = cib_NODECOPY;					} else if(add_node_copy(parent, new_obj) == NULL) {			crm_err("Failed to add  <%s id=%s>",				 crm_str(object_name), crm_str(object_id));			result = cib_NODECOPY;		} else {			crm_debug("Added  <%s id=%s>",				  crm_str(object_name), crm_str(object_id));			if(object_id == NULL) {				/*  placeholder object */				equiv_node = find_xml_node(					parent, object_name, TRUE);							} else {				equiv_node = find_entity(					parent, object_name, object_id);			}		}			} else {		crm_debug_2("Found node <%s id=%s> to update",			    crm_str(object_name), crm_str(object_id));		replace = crm_element_value(new_obj, XML_CIB_ATTR_REPLACE);				if(replace != NULL) {			crm_data_t *remove = find_xml_node(				equiv_node, replace, FALSE);			if(remove != NULL) {				crm_debug_3("Replacing node <%s> in <%s>",					  replace, crm_element_name(equiv_node));				zap_xml_from_parent(equiv_node, remove);			}			xml_remove_prop(new_obj, XML_CIB_ATTR_REPLACE);			xml_remove_prop(equiv_node, XML_CIB_ATTR_REPLACE);		}				if(safe_str_eq(XML_CIB_TAG_STATE, object_name)){			update_node_state(equiv_node, new_obj);					} else {			copy_in_properties(equiv_node, new_obj);		}		crm_debug_3("Processing children of <%s id=%s>",			  crm_str(object_name), crm_str(object_id));				xml_child_iter(			new_obj, a_child, NULL, 			int tmp_result = 0;			crm_debug_3("Updating child <%s id=%s>",				  crm_element_name(a_child),				  crm_element_value(a_child, XML_ATTR_ID));						tmp_result =				update_cib_object(equiv_node, a_child, force);			/*  only the first error is likely to be interesting */			if(tmp_result != cib_ok) {				crm_err("Error updating child <%s id=%s>",					crm_element_name(a_child),					crm_element_value(a_child, XML_ATTR_ID));								if(result == cib_ok) {					result = tmp_result;				}			}			);			}	crm_debug_3("Finished with <%s id=%s>",		  crm_str(object_name), crm_str(object_id));	#if INTERMEDIATE_NOTIFICATIONS	cib_post_notify(CRM_OP_CIB_UPDATE, new_obj, result, equiv_node);#endif	crm_free(object_id);	return result;}