send_complete(blob.text, blob.update, blob.reason);
send_complete(blob.text, blob.update, blob.reason, i_cancel);
extract_event(crm_data_t *msg){	const char *event_node = NULL;	struct abort_blob_s 	{			const char *text;			crm_data_t *update;			te_reason_t reason;	};	struct abort_blob_s blob = { NULL, NULL, 0 };	blob.reason = te_update;/*[cib fragment]...<status>   <node_state id="node1" state=CRMD_STATE_ACTIVE exp_state="active">     <lrm>       <lrm_resources>	 <rsc_state id="" rsc_id="rsc4" node_id="node1" rsc_state="stopped"/>*/	crm_debug_4("Extracting event from %s", crm_element_name(msg));	xml_child_iter(		msg, node_state, XML_CIB_TAG_STATE,		crm_data_t *resources = NULL;		const char *ccm_state  = crm_element_value(			node_state, XML_CIB_ATTR_INCCM);		const char *crmd_state  = crm_element_value(			node_state, XML_CIB_ATTR_CRMDSTATE);		blob.update = node_state;				event_node = crm_element_value(node_state, XML_ATTR_UNAME);		crm_log_xml_debug_3(node_state,"Processing");		if(crm_element_value(node_state, XML_CIB_ATTR_SHUTDOWN) != NULL) {			blob.text = "Aborting on "XML_CIB_ATTR_SHUTDOWN" attribute";			break;			/* #if 1 */			/* is this still required??? */		} else if(crm_element_value(node_state, CRM_OP_FENCE) != NULL) {			/* node marked for STONITH			 *   possibly by us when a shutdown timed out			 */			int action_id = -1;			crm_debug_3("Checking for STONITH");			event_node = crm_element_value(node_state, XML_ATTR_UNAME);			action_id = match_down_event(				event_node, CRM_OP_SHUTDOWN, LRM_OP_DONE);						if(action_id < 0) {				blob.text="Stonith/shutdown event not matched";				break;			} else {				process_trigger(action_id);				check_for_completion();			}/* #endif */		}		resources = find_xml_node(node_state, XML_CIB_TAG_LRM, FALSE);		resources = find_xml_node(			resources, XML_LRM_TAG_RESOURCES, FALSE);		/*		 * node state update... possibly from a shutdown we requested		 */		crm_debug_3("Processing state update");		if(safe_str_eq(ccm_state, XML_BOOLEAN_FALSE)		   || safe_str_eq(crmd_state, CRMD_JOINSTATE_DOWN)) {			int action_id = -1;			crm_debug_3("A shutdown we requested?");			action_id = match_down_event(				event_node, NULL, LRM_OP_DONE);						if(action_id >= 0) {				process_trigger(action_id);				check_for_completion();			} else {				blob.text="Stonith/shutdown event not matched";				break;			}		}		if(resources != NULL) {			/* LRM resource update...			 */			xml_child_iter(				resources, child, NULL, 				crm_log_xml_debug_3(					child,"Processing LRM resource update");				if(!process_graph_event(child, event_node)) {					/* the transition has already been					 * aborted and with better details					 */					return TRUE;				}				);		}		);	if(blob.text != NULL) {		send_complete(blob.text, blob.update, blob.reason);	}		return TRUE;}