this_action = crm_element_value( action->xml, XML_LRM_ATTR_TASK);      if(filter != NULL && safe_str_neq(this_action, filter)) { continue; }
match_down_event(const char *target, const char *filter, int rc){	const char *allow_fail  = NULL;	const char *this_action = NULL;	const char *this_node   = NULL;	action_t *match = NULL;	slist_iter(		synapse, synapse_t, graph, lpc,		/* lookup event */		slist_iter(			action, action_t, synapse->actions, lpc2,			crm_data_t *action_args = NULL;			if(action->type != action_type_crm) {				continue;			}						this_action = crm_element_value(				action->xml, XML_LRM_ATTR_TASK);/* 			if(crm_element_value(action->xml, XML_LRM_ATTR_RSCID)) { *//* 				continue; */				/* 			} else */				if(filter != NULL && safe_str_neq(this_action, filter)) {				continue;			}									if(safe_str_eq(this_action, CRM_OP_FENCE)) {				action_args = find_xml_node(					action->xml, XML_TAG_ATTRS, TRUE);				this_node = crm_element_value(					action_args, XML_LRM_ATTR_TARGET_UUID);			} else if(safe_str_eq(this_action, CRM_OP_SHUTDOWN)) {				this_node = crm_element_value(					action->xml, XML_LRM_ATTR_TARGET_UUID);			} else {				crm_err("Action %d : Bad action %s",					action->id, this_action);				continue;			}						if(safe_str_neq(this_node, target)) {				crm_debug("Action %d : Node mismatch: %s",					 action->id, this_node);				continue;			}			match = action;			);		if(match != NULL) {			break;		}		);		if(match == NULL) {		crm_debug_3("didnt match current action");		return -1;	}	crm_debug_3("matched");	/* stop this event's timer if it had one */	stop_te_timer(match->timer);	/* Process OP status */	switch(rc) {		case STONITH_SUCCEEDED:			break;		case STONITH_CANNOT:		case STONITH_TIMEOUT:		case STONITH_GENERIC:			allow_fail = crm_element_value(match->xml, "allow_fail");			if(FALSE == crm_is_true(allow_fail)) {				crm_err("Stonith of %s failed (%d)..."					" aborting transition.", target, rc);				send_complete("Stonith failed",					      match->xml, te_failed, i_cancel);				return -2;			}			break;		default:			crm_err("Unsupported action result: %d", rc);			send_complete("Unsupport Stonith result",				      match->xml, te_failed, i_cancel);			return -2;	}		crm_debug_3("Action %d was successful, looking for next action",		match->id);	match->complete = TRUE;	return match->id;}