crm_trace("Processing simple state update");
crm_devel("Processing simple state update");
extract_event(xmlNodePtr msg){	gboolean abort  = FALSE;	xmlNodePtr iter = NULL;	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_trace("Extracting event");		iter = msg;		while(abort == FALSE && iter != NULL) {		xmlNodePtr node_state = iter;		xmlNodePtr child = iter->children;		xmlNodePtr shutdown = NULL;		const char *state = xmlGetProp(			node_state, XML_CIB_ATTR_CRMDSTATE);		iter = iter->next;		crm_xml_devel(node_state,"Processing");				if(xmlGetProp(node_state, XML_CIB_ATTR_SHUTDOWN) != NULL) {			crm_trace("Aborting on %s attribute",				  XML_CIB_ATTR_SHUTDOWN);			abort = TRUE;					} else if(xmlGetProp(node_state, XML_CIB_ATTR_STONITH) != NULL) {			/* node marked for STONITH			 *   possibly by us when a shutdown timmed out			 */			crm_trace("Checking for STONITH");			event_node = xmlGetProp(node_state, XML_ATTR_UNAME);			shutdown = create_shutdown_event(				event_node, LRM_OP_TIMEOUT);			process_graph_event(shutdown);			free_xml(shutdown);					} else if(state != NULL && child == NULL) {			/* simple node state update...			 *   possibly from a shutdown we requested			 */			crm_trace("Processing simple state update");			if(safe_str_neq(state, OFFLINESTATUS)) {				/* always recompute */				abort = TRUE;				continue;			}						event_node = xmlGetProp(node_state, XML_ATTR_UNAME);			shutdown = create_shutdown_event(				event_node, LRM_OP_DONE);			process_graph_event(shutdown);			free_xml(shutdown);		} else if(state == NULL && child != NULL) {			/* LRM resource update...			 */			crm_trace("Processing LRM resource update");			child = find_xml_node(node_state, XML_CIB_TAG_LRM);			child = find_xml_node(child, XML_LRM_TAG_RESOURCES);			if(child != NULL) {				child = child->children;			} else {				abort = TRUE;			}						event_node = xmlGetProp(node_state, XML_ATTR_UNAME);			while(abort == FALSE && child != NULL) {				process_graph_event(child);				child = child->next;			}			} else if(state != NULL && child != NULL) {			/* this is a complex event and could not be completely			 * due to any request we made			 */			crm_trace("Aborting on complex update");			abort = TRUE;					} else {			/* ignore */			crm_err("Ignoring message");		}	}		return !abort;}