event_node = xmlGetProp(node_state, XML_ATTR_ID); 
event_node = xmlGetProp(node_state, XML_ATTR_UNAME); 
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_rc     = NULL;	char *code = 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 = find_xml_node(msg, XML_TAG_FRAGMENT);	section = xmlGetProp(iter, XML_ATTR_SECTION);	if(safe_str_eq(section, XML_CIB_TAG_CRMCONFIG)) {		// ignore - for the moment		crm_debug("Ignoring changes to the %s section", XML_CIB_TAG_CRMCONFIG);		return TRUE;			} else if(safe_str_neq(section, XML_CIB_TAG_STATUS)) {		// these too are never expected			crm_debug("Ignoring changes outside the %s section", XML_CIB_TAG_STATUS);		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, XML_CIB_ATTR_CRMDSTATE);		iter = iter->next;		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");			code = crm_itoa(LRM_OP_TIMEOUT);			event_node = xmlGetProp(node_state, XML_ATTR_ID);			abort = !process_graph_event(				event_node, NULL, XML_CIB_ATTR_SHUTDOWN, code);			crm_free(code);					} else if(state != NULL && child == NULL) {			/* simple node state update...			 *   possibly from a shutdown we requested			 */			crm_trace("Processing simple state update");			code = crm_itoa(LRM_OP_DONE);			if(safe_str_neq(state, OFFLINESTATUS)) {				// always recompute				abort = TRUE;				continue;			}						event_node = xmlGetProp(node_state, XML_ATTR_ID);			abort = !process_graph_event(				event_node, NULL, XML_CIB_ATTR_SHUTDOWN, code);						crm_free(code);		} 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_ID);			while(abort == FALSE && child != NULL) {				event_action = xmlGetProp(					child, XML_LRM_ATTR_LASTOP);				event_rsc    = xmlGetProp(					child, XML_ATTR_ID);				event_rc     = xmlGetProp(					child, XML_LRM_ATTR_OPCODE);								abort = !process_graph_event(					event_node, event_rsc, event_action,					event_rc);				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;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/31dd1f16e41f41bcd399655f2d07aa1d79768280/tengine.c/clean/crm/tengine/tengine.c