if(match == NULL) { crm_debug_2("didnt match current action");
if(transition_counter < transition_i) { crm_err("Detected an action from a __future__ transition:" " %d vs. %d", transition_i, transition_counter);
match_graph_event(action_t *action, crm_data_t *event, const char *event_node){	const char *allow_fail  = NULL;	const char *this_action = NULL;	const char *this_node   = NULL;	const char *this_rsc    = NULL;	const char *event_rsc;	const char *rsc_state;	const char *event_action;	const char *event_rc;	const char *op_status;		action_t *match = NULL;	int op_status_i = -3;	if(event == NULL) {		crm_debug_4("Ignoring NULL event");		return -1;	}		event_action = crm_element_value(event, XML_LRM_ATTR_LASTOP);	event_rsc    = crm_element_value(event, XML_ATTR_ID);	event_rc     = crm_element_value(event, XML_LRM_ATTR_RC);	rsc_state    = crm_element_value(event, XML_LRM_ATTR_RSCSTATE);	op_status    = crm_element_value(event, XML_LRM_ATTR_OPSTATUS);		if(op_status != NULL) {		op_status_i = atoi(op_status);	}		this_action = crm_element_value(action->xml, XML_LRM_ATTR_TASK);	this_node   = crm_element_value(action->xml, XML_LRM_ATTR_TARGET);	this_rsc    = crm_element_value(action->xml, XML_LRM_ATTR_RSCID);		crm_debug_2("matching against: <%s task=%s node=%s rsc_id=%s/>",		  crm_element_name(action->xml), this_action, this_node, this_rsc);	if(safe_str_neq(this_action, event_action)) {			crm_debug_2("Action %d : Action mismatch %s",			    action->id, event_action);			} else if(safe_str_eq(crm_element_name(action->xml), XML_GRAPH_TAG_CRM_EVENT)) {		if(safe_str_eq(this_action, CRM_OP_FENCE)) {					} else if(safe_str_neq(this_node, event_node)) {			crm_debug_2("node mismatch: %s", event_node);		} else {			crm_debug_3(XML_GRAPH_TAG_CRM_EVENT);			match = action;		}				crm_debug_3(XML_GRAPH_TAG_CRM_EVENT);		match = action;			} else if(safe_str_neq(this_node, event_node)) {		crm_debug_2("Action %d : Node mismatch %s",			    action->id, event_node);	} else if(safe_str_eq(crm_element_name(action->xml), XML_GRAPH_TAG_RSC_OP)) {		crm_debug_3(XML_GRAPH_TAG_RSC_OP);		if(safe_str_eq(this_rsc, event_rsc)) {			match = action;		} else {			crm_debug_2("Action %d : bad rsc (%s) != (%s)",				 action->id, this_rsc, event_rsc);		}	}		if(match == NULL) {		crm_debug_2("didnt match current action");		return -1;	}	crm_debug_2("matched");	/* stop this event's timer if it had one */	stop_te_timer(match->timer);	/* Process OP status */	allow_fail = crm_element_value(match->xml, "allow_fail");	switch(op_status_i) {		case LRM_OP_PENDING:			/* should never happen */			CRM_DEV_ASSERT(op_status_i != LRM_OP_PENDING);			break;		case LRM_OP_DONE:			break;		case LRM_OP_ERROR:		case LRM_OP_TIMEOUT:		case LRM_OP_NOTSUPPORTED:			crm_warn("Action %s for \"%s\" on %s failed: %s",				event_action, event_rsc, event_node,				op_status2text(op_status_i));			if(FALSE == crm_is_true(allow_fail)) {				send_complete("Action failed", event,					      te_failed, i_cancel);				return -2;			}			break;		case LRM_OP_CANCELLED:			/* do nothing?? */			crm_err("Dont know what to do for cancelled ops yet");			break;		default:			crm_err("Unsupported action result: %d", op_status_i);			send_complete("Unsupport action result",				      event, te_failed, i_cancel);			return -2;	}		te_log_action(LOG_DEBUG, "Action %d confirmed", match->id);	match->complete = TRUE;	return match->id;}