const char *crmd_state = xmlGetProp(
const char *crmd_state = crm_element_value(
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");	if(msg != NULL) {		iter = msg->children;	}		while(abort == FALSE && iter != NULL) {		xmlNodePtr shutdown = NULL;		xmlNodePtr resources = NULL;		xmlNodePtr node_state = iter;		const char *ccm_state  = xmlGetProp(			node_state, XML_CIB_ATTR_INCCM);		const char *crmd_state = xmlGetProp(			node_state, XML_CIB_ATTR_CRMDSTATE);		const char *join_state = xmlGetProp(			node_state, XML_CIB_ATTR_JOINSTATE);		iter = iter->next;		crm_xml_devel(node_state,"Processing");				if(xmlGetProp(node_state, XML_CIB_ATTR_SHUTDOWN) != NULL) {			crm_devel("Aborting on %s attribute",				  XML_CIB_ATTR_SHUTDOWN);			abort = TRUE;			continue;					} else if(xmlGetProp(node_state, XML_CIB_ATTR_STONITH) != NULL) {			/* node marked for STONITH			 *   possibly by us when a shutdown timmed out			 */			crm_devel("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);			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_devel("Processing state update");			if(crmd_state != NULL			   && safe_str_neq(crmd_state, OFFLINESTATUS)) {				/* always recompute */				crm_devel("Abort - crmd not offline");				abort = TRUE;							} else if(join_state != NULL				  && safe_str_neq(join_state, CRMD_JOINSTATE_DOWN)) {				crm_devel("Abort - new CRMD node");				abort = TRUE;			} else {				/* this may be called more than once per shutdown				 * ie. once per update of each field				 */				crm_devel("Checking if this was a known shutdown");				event_node = xmlGetProp(node_state, XML_ATTR_UNAME);				shutdown = create_shutdown_event(event_node, LRM_OP_DONE);								abort = !process_graph_event(shutdown);				free_xml(shutdown);			}						if(abort) {				crm_xml_debug(					node_state, "Update resulted in state-based abort");			} else if(ccm_state != NULL				  && safe_str_eq(ccm_state, XML_BOOLEAN_YES)) {				crm_devel("Ignore - new CCM node");			}		}		if(abort == FALSE && resources != NULL) {			/* LRM resource update...			 */			xmlNodePtr child = resources->children;						event_node = xmlGetProp(node_state, XML_ATTR_UNAME);			while(abort == FALSE && child != NULL) {				crm_xml_devel(child, "Processing LRM resource update");				abort = !process_graph_event(child);				child = child->next;			}			}	}		return !abort;}