xmlSetProp(node_entry, XML_ATTR_ID, name);  xmlSetProp(node_entry, XML_CIB_ATTR_VARVALUE, value); xmlSetProp(node_entry, XML_CIB_ATTR_ACTION, "del");
set_xml_property_copy(node_entry, XML_ATTR_ID, name);  set_xml_property_copy(node_entry, XML_CIB_ATTR_VARVALUE, value); set_xml_property_copy(node_entry, XML_CIB_ATTR_ACTION, "del");
handleModify(void){    CRM_DEBUG("Modifying existing CIB object");    if(obj_type == NULL)    {	cl_log(LOG_ERR, "You must specify an object type.  Use the -o option.");	return NULL;// error    }    xmlNodePtr xml_root_node, new_xml_node = NULL;    const char *section_name = NULL;        if(strcmp("node", obj_type) == 0)    {	section_name = XML_CIB_TAG_NODES;	CRM_DEBUG3("Modifing existing %s (%s) object", section_name, id);	if(id == NULL) return NULL;	new_xml_node = xmlNewNode( NULL, XML_CIB_TAG_NODE);	xmlSetProp(new_xml_node, XML_ATTR_ID, id);	if(subtype != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_NODETYPE, subtype);    }    else if(strcmp("resource", obj_type) == 0)    {	section_name = XML_CIB_TAG_RESOURCES;	CRM_DEBUG3("Modifing existing %s (%s) object", section_name, id);	if(id == NULL) return NULL;	new_xml_node = xmlNewNode( NULL, XML_CIB_TAG_RESOURCE);	xmlSetProp(new_xml_node, XML_ATTR_ID, id);	if(subtype       != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_RESTYPE     , subtype);	if(description   != NULL) xmlSetProp(new_xml_node, XML_ATTR_DESC            , description);	if(max_instances != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_MAXINSTANCE , max_instances);	if(priority      != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_PRIORITY    , priority);	if(res_timeout   != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_RESTIMEOUT , res_timeout);	xmlSetProp(new_xml_node, XML_ATTR_TSTAMP, getNow());	// TODO: need to handle add/remove of allowed nodes	// add Nodes To Resources	if(list_del->num_items > 0)	{	    str_list_t *iter = list_del;	    while(list_del != list_del_last)	    {		char *name  = NULL;		char *value = NULL;		if(decodeNVpair(iter->value, '=', &name, &value))		{		    xmlNodePtr node_entry = xmlNewNode(NULL, XML_CIB_ATTR_NODEREF);					    xmlSetProp(node_entry, XML_ATTR_ID, name);		    xmlSetProp(node_entry, XML_CIB_ATTR_WEIGHT, value);		    xmlSetProp(node_entry, XML_ATTR_TSTAMP, getNow());		    xmlSetProp(node_entry, XML_CIB_ATTR_ACTION, "del");		    xmlAddChild(new_xml_node, node_entry);		}		iter = iter->next;	    }	}	// add Nodes To Resources	if(list_add->num_items > 0)	{	    str_list_t *iter = list_add;	    while(list_add != list_add_last)	    {		char *name  = NULL;		char *value = NULL;		if(decodeNVpair(iter->value, '=', &name, &value))		{		    xmlNodePtr node_entry = xmlNewNode(NULL, XML_CIB_ATTR_NODEREF);					    xmlSetProp(node_entry, XML_ATTR_ID, name);		    xmlSetProp(node_entry, XML_CIB_ATTR_WEIGHT, value);		    xmlSetProp(node_entry, XML_ATTR_TSTAMP, getNow());		    xmlSetProp(node_entry, XML_CIB_ATTR_ACTION, "add");		    xmlAddChild(new_xml_node, node_entry);		}		iter = iter->next;	    }	}    }    else if(strcmp("constraint", obj_type) == 0)    {	section_name = XML_CIB_TAG_CONSTRAINTS;	CRM_DEBUG3("Modifing existing %s (%s) object", section_name, id);	if(id == NULL) return NULL;	new_xml_node = xmlNewNode( NULL, XML_CIB_TAG_CONSTRAINT);	xmlSetProp(new_xml_node, XML_ATTR_ID, id);	if(subtype     != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_CONTYPE, subtype);	if(description != NULL) xmlSetProp(new_xml_node, XML_ATTR_DESC       , description);	if(resource[0] != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_RESID1 , resource[0]);	if(resource[1] != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_RESID2 , resource[1]);	if(clear       != NULL) xmlSetProp(new_xml_node, XML_CIB_ATTR_CLEAR  , clear);	// del Name Value pairs To constraint s	if(list_del->num_items > 0)	{	    str_list_t *iter = list_del;	    while(list_del != list_del_last)	    {		char *name  = NULL;		char *value = NULL;		if(decodeNVpair(iter->value, '=', &name, &value))		{		    xmlNodePtr node_entry = xmlNewNode(NULL, XML_CIB_TAG_NVPAIR);					    xmlSetProp(node_entry, XML_ATTR_ID, name);//			xmlSetProp(node_entry, XML_CIB_ATTR_VARTYPE, subtype);		    xmlSetProp(node_entry, XML_CIB_ATTR_VARVALUE, value);		    xmlSetProp(node_entry, XML_CIB_ATTR_ACTION, "del");		    xmlAddChild(new_xml_node, node_entry);		}		iter = iter->next;	    }	}		// add Name Value pairs To constraint s	if(list_add->num_items > 0)	{	    str_list_t *iter = list_add;	    while(list_add != list_add_last)	    {		char *name  = NULL;		char *value = NULL;		if(decodeNVpair(iter->value, '=', &name, &value))		{		    xmlNodePtr node_entry = xmlNewNode(NULL, XML_CIB_ATTR_NODEREF);					    xmlSetProp(node_entry, XML_ATTR_ID, name);//			xmlSetProp(node_entry, XML_CIB_ATTR_VARTYPE, subtype);		    xmlSetProp(node_entry, XML_CIB_ATTR_VARVALUE, value);		    xmlSetProp(node_entry, XML_CIB_ATTR_ACTION, "add");		    xmlAddChild(new_xml_node, node_entry);		}		iter = iter->next;	    }	}	xmlSetProp(new_xml_node, XML_ATTR_TSTAMP, getNow());    }    else    {	cl_log(LOG_INFO, "Object Type (%s) not supported", obj_type);	return NULL;    }        // create the cib request    xml_root_node = wrapUpdate(new_xml_node, section_name, "update");        CRM_DEBUG("Creation of modify request complete");    return xml_root_node;    }