te_log_action(LOG_DEBUG, "Transition status: %s by CIB update: %s", last_state!=s_idle?"Aborted":"Triggered", text);
te_log_action( LOG_DEBUG, "%d - Transition status: %s by CIB update: %s", transition_counter, last_state!=s_idle?"Aborted":"Triggered", text);
send_complete(const char *text, crm_data_t *msg,	      te_reason_t reason, te_fsa_input_t input){		int log_level = LOG_DEBUG;	int unconfirmed = unconfirmed_actions();	int pending_callbacks = num_cib_op_callbacks();	HA_Message *cmd = NULL;	const char *op = CRM_OP_TEABORT;	static te_reason_t last_reason = te_done;	static crm_data_t *last_msg = NULL;	static const char *last_text = NULL;	te_fsa_state_t last_state = te_fsa_state;	te_fsa_state = te_state_matrix[input][te_fsa_state];	if(te_fsa_state != last_state) {		crm_debug("State change %d->%d", last_state, te_fsa_state);	}		if(te_fsa_state == s_abort_pending	   && (unconfirmed == 0 || reason == te_timeout || reason == te_abort_timeout)) {		crm_debug("Faking i_cmd_complete: %d/%d", last_state, input);		te_fsa_state = te_state_matrix[i_cmd_complete][te_fsa_state];		crm_debug("State change %d->%d", last_state, te_fsa_state);		crm_debug("Stopping abort timer");		stop_te_timer(abort_timer);	} else if(te_fsa_state ==s_abort_pending && te_fsa_state !=last_state) {		abort_timer->timeout = transition_timer->timeout;		crm_info("Starting abort timer: %dms", abort_timer->timeout);		start_te_timer(abort_timer);	}	if(te_fsa_state == s_updates_pending && pending_callbacks == 0) {		crm_debug("Faking i_cib_complete: %d/%d", last_state, input);		te_fsa_state = te_state_matrix[i_cib_complete][te_fsa_state];				crm_debug("State change %d->%d", last_state, te_fsa_state);	}	if(te_fsa_state == last_state	   && (last_state==s_abort_pending || last_state==s_updates_pending)) {		crm_info("Transaction already cancelled");	}			switch(reason) {		case te_update:			te_log_action(LOG_DEBUG,				      "Transition status: %s by CIB update: %s",				      last_state!=s_idle?"Aborted":"Triggered",				      text);			if(msg != NULL) {				if(safe_str_eq(crm_element_name(msg),					       XML_TAG_CIB)) {					crm_data_t *status = get_object_root(XML_CIB_TAG_STATUS, msg);					crm_data_t *generation = create_xml_node(NULL, XML_TAG_CIB);					crm_debug("Cause:"						 " full CIB replace/update");					copy_in_properties(generation, msg);					crm_log_xml_debug(generation, "[generation]");					crm_log_xml_debug(status, "[in ]");					free_xml(generation);									} else {					crm_log_xml_debug(msg, "Cause");				}			}			break;		case te_halt:			te_log_action(LOG_INFO,"Transition status: Stopped%s%s",				 text?": ":"", text?text:"");			break;		case te_abort_confirmed:			te_log_action(LOG_INFO,				      "Transition status: Confirmed Stopped%s%s",				      text?": ":"", text?text:"");			break;		case te_abort:			te_log_action(LOG_INFO,"Transition status: Stopped%s%s",				      text?": ":"", text?text:"");			break;		case te_done:			te_log_action(LOG_INFO,				      "Transition status: Complete%s%s",				      text?": ":"", text?text:"");			break;		case te_abort_timeout:			te_log_action(LOG_ERR,				      "Transition status: Abort timed out after %dms",				      abort_timer->timeout);			log_level = LOG_WARNING;			break;		case te_timeout:			te_log_action(LOG_ERR,				      "Transition status: Timed out after %dms",				      transition_timer->timeout);			log_level = LOG_WARNING;			break;		case te_failed:			te_log_action(LOG_ERR, "Transition status: Aborted by failed action: %s", text);			crm_log_xml_debug(msg, "Cause");			log_level = LOG_WARNING;			break;	}		if(te_fsa_state != s_idle) {		if(last_text == NULL) {			/* store the original input */			crm_debug("Storing TE input.");			last_msg = NULL;			if(msg != NULL) {				last_msg = copy_xml(msg);			}			last_text   = text;			last_reason = reason;		}		crm_info("Delay abort until %d updates and %d actions complete (state=%d).",			pending_callbacks, unconfirmed, te_fsa_state);		return;			} else if(last_text != NULL) {		/* restore the original reason we aborted */		crm_debug("Restoring TE input.");		msg    = last_msg;		text   = last_text;		reason = last_reason;		last_msg = NULL;		last_text = NULL;	}	CRM_DEV_ASSERT(pending_callbacks == 0);	print_state(log_level);	initialize_graph();	switch(reason) {		case te_abort:		case te_abort_timeout:		case te_failed:		case te_update:			op = CRM_OP_TEABORT;			break;		case te_halt:			op = CRM_OP_TECOMPLETE;			break;		case te_abort_confirmed:			op = CRM_OP_TEABORTED;			break;		case te_done:			op = CRM_OP_TECOMPLETE;			break;		case te_timeout:			op = CRM_OP_TETIMEOUT;			break;	}		cmd = create_request(		op, NULL, NULL, CRM_SYSTEM_DC, CRM_SYSTEM_TENGINE, NULL);	if(text != NULL) {		ha_msg_add(cmd, "message", text);	}	free_xml(last_msg);	#ifdef TESTING	if(reason == te_done) {		crm_log_message(LOG_INFO, cmd);	} else {		crm_log_message(LOG_ERR, cmd);	}		g_main_quit(mainloop);	return;#else	send_ipc_message(crm_ch, cmd);#endif	#if 0	if(is_ipc_empty(crm_ch)	   && is_ipc_empty(te_cib_conn->cmds->channel(te_cib_conn)) ) {		static gboolean mem_needs_init = TRUE;		if(mem_needs_init) {			crm_debug("Reached a stable point:"				  " reseting memory usage stats to zero");			crm_zero_mem_stats(NULL);			mem_needs_init = FALSE;					} else {			crm_err("Reached a stable point:"				  " checking memory usage");			crm_mem_stats(NULL);		}	}#endif	}