update = create_cib_fragment(node_state, NULL);
update = create_cib_fragment(node_state, XML_CIB_TAG_STATUS);
tengine_stonith_callback(stonith_ops_t * op, void * private_data){	int *action_id = NULL;	const char *fail_text = "Fencing op failed";	int fail_code = te_failed;	void *fail_data = NULL;	crm_data_t *update = NULL;	if(op == NULL) {		crm_err("Called with a NULL op!");		return;	}		crm_info("optype=%d, node_name=%s, result=%d, node_list=%s",		 op->optype, op->node_name, op->op_result,		 (char *)op->node_list);		/* this will mark the event complete if a match is found */	crm_malloc0(action_id, sizeof(int));	*action_id = match_down_event(		op->node_uuid, CRM_OP_FENCE, op->op_result);	if(*action_id == -1) {		crm_err("Stonith action not matched");	}		if(op->op_result == STONITH_SUCCEEDED) {		enum cib_errors rc = cib_ok;		const char *target = op->node_name;		const char *uuid   = op->node_uuid;				/* zero out the node-status & remove all LRM status info */		crm_data_t *node_state = create_xml_node(			NULL, XML_CIB_TAG_STATE);		CRM_DEV_ASSERT(op->node_name != NULL);		CRM_DEV_ASSERT(op->node_uuid != NULL);		crm_xml_add(node_state, XML_ATTR_UUID, uuid);		crm_xml_add(node_state, XML_ATTR_UNAME, target);		crm_xml_add(node_state, XML_CIB_ATTR_HASTATE, DEADSTATUS);		crm_xml_add(node_state, XML_CIB_ATTR_INCCM, XML_BOOLEAN_NO);		crm_xml_add(node_state, XML_CIB_ATTR_CRMDSTATE, OFFLINESTATUS);		crm_xml_add(			node_state, XML_CIB_ATTR_JOINSTATE,CRMD_JOINSTATE_DOWN);		crm_xml_add(			node_state, XML_CIB_ATTR_EXPSTATE, CRMD_JOINSTATE_DOWN);		crm_xml_add(node_state, XML_CIB_ATTR_REPLACE, XML_CIB_TAG_LRM);		create_xml_node(node_state, XML_CIB_TAG_LRM);				update = create_cib_fragment(node_state, NULL);		free_xml(node_state);			rc = te_cib_conn->cmds->modify(			te_cib_conn, XML_CIB_TAG_STATUS, update, NULL,			cib_quorum_override);			if(*action_id < 0) {			fail_text = "Stonith not matched";			fail_data = update;			fail_code = te_update;		} else if(rc < cib_ok) {			crm_err("CIB update failed: %s", cib_error2string(rc));			fail_text = "Couldnt update CIB after stonith";			fail_data = update;			fail_code = te_failed;					} else {			add_cib_op_callback(				rc, FALSE, action_id, cib_fencing_updated);			free_xml(update);			return;		}			}	send_complete(fail_text, fail_data, fail_code, i_cancel);	process_trigger(*action_id);	free_xml(update);	return;}