event_action = xmlGetProp(child, "last_op"); event_node   = xmlGetProp(child, "op_node"); event_rsc    = xmlGetProp(child, "id"); event_status = xmlGetProp(child, "op_status"); event_rc     = xmlGetProp(child, "op_code");
event_action = xmlGetProp( child, XML_LRM_ATTR_LASTOP); event_node   = xmlGetProp( child, XML_LRM_ATTR_TARGET); event_rsc    = xmlGetProp( child, XML_ATTR_ID); event_status = xmlGetProp( child, XML_LRM_ATTR_OPSTATE); event_rc     = xmlGetProp( child, XML_LRM_ATTR_OPCODE);
extract_event(xmlNodePtr msg){	gboolean abort      = FALSE;	xmlNodePtr iter     = NULL;	const char *section = NULL;	const char *event_action = NULL;	const char *event_node   = NULL;	const char *event_rsc    = NULL;	const char *event_status = NULL;	const char *event_rc     = NULL;	/*[cib fragment]...<status>   <node_state id="node1" state="active" exp_state="active">     <lrm>       <lrm_resources>	 <rsc_state id="" rsc_id="rsc4" node_id="node1" rsc_state="stopped"/>*/	xml_message_debug(msg, "TE Event");		iter = find_xml_node(msg, XML_TAG_FRAGMENT);	section = xmlGetProp(iter, "section");	if(safe_str_neq(section, XML_CIB_TAG_STATUS)) {		// these too are never expected		return FALSE;	}		iter = find_xml_node(iter, XML_TAG_CIB);	iter = get_object_root(XML_CIB_TAG_STATUS, iter);	iter = iter->children;		while(abort == FALSE && iter != NULL) {		xmlNodePtr node_state = iter;		xmlNodePtr child = iter->children;		const char *state = xmlGetProp(node_state, "state");		iter = iter->next;		if(state != NULL && child == NULL) {			/* node state update,			 * possibly from a shutdown we requested			 */			CRM_DEBUG("state no child");						event_status = state;			event_node   = xmlGetProp(node_state, XML_ATTR_ID);			if(safe_str_eq(event_status, "down")) {				event_action = "shutdown";			}						abort = !process_graph_event(event_node,						     event_rsc,						     event_action,						     event_status,						     event_rc);		} else if(state != NULL && child != NULL) {			/* this is a complex event and could not be completely			 * due to any request we made			 */			abort = TRUE;			CRM_DEBUG("state and child");					} else {			CRM_DEBUG("child no state");			child = find_xml_node(node_state, "lrm");			child = find_xml_node(child, "lrm_resources");			if(child != NULL) {				child = child->children;			} else {				abort = TRUE;			}						while(abort == FALSE && child != NULL) {				event_action = xmlGetProp(child, "last_op");				event_node   = xmlGetProp(child, "op_node");				event_rsc    = xmlGetProp(child, "id");				event_status = xmlGetProp(child, "op_status");				event_rc     = xmlGetProp(child, "op_code");								abort = !process_graph_event(event_node,							     event_rsc,							     event_action,							     event_status,							     event_rc);				child = child->next;			}			}	}		return !abort;}