send_complete( "Aborting on "XML_CIB_ATTR_SHUTDOWN" attribute", node_state, te_update);
blob.text = "Aborting on "XML_CIB_ATTR_SHUTDOWN" attribute";
extract_event(crm_data_t *msg){	gboolean abort  = FALSE;	const char *event_node = NULL;/*[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);		const char *join_state = crm_element_value(			node_state, XML_CIB_ATTR_JOINSTATE);		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) {			send_complete(				"Aborting on "XML_CIB_ATTR_SHUTDOWN" attribute",				node_state, te_update);			break;					} else if(crm_element_value(node_state, CRM_OP_FENCE) != NULL) {			/* node marked for STONITH			 *   possibly by us when a shutdown timmed 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) {				send_complete(					"Stonith/shutdown event not matched",					node_state, te_update);				break;			} else {				process_trigger(action_id);				check_for_completion();			}			continue;		}		resources = find_xml_node(node_state, XML_CIB_TAG_LRM, FALSE);		resources = find_xml_node(			resources, XML_LRM_TAG_RESOURCES, FALSE);		if(crmd_state != NULL || ccm_state != NULL || join_state != NULL) {			/* simple node state update...			 *   possibly from a shutdown we requested			 */			crm_debug_3("Processing state update");			if( (crmd_state != NULL && safe_str_neq(				     crmd_state, OFFLINESTATUS))			    || (join_state != NULL && safe_str_neq(					join_state, CRMD_JOINSTATE_DOWN))			    || safe_str_eq(ccm_state, XML_BOOLEAN_TRUE)) {				/* the node is comming up,				 *  only recompute after the join completes,				 *  we dont need to check for this				 */				crm_debug("Ignoreing status update of"					  " starting node.");				continue;							} else {				/* this may be called more than once per shutdown				 * ie. once per update of each field				 */				int action_id = -1;				crm_debug_3("Checking if this was a known shutdown");				action_id = match_down_event(					event_node, NULL, LRM_OP_DONE);				if(action_id < 0) {					send_complete("Stonith/shutdown event not matched", node_state, te_update);					break;				} else {					process_trigger(action_id);					check_for_completion();				}			}						if(ccm_state != NULL && crm_is_true(ccm_state)) {				crm_debug_3("Ignore - new CCM node");			}		}		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(abort) {				break;			}		}		);		return !abort;}