CRM_DEV_ASSERT(is_set(fsa_input_register, R_IN_TRANSITION) == FALSE);
do_te_invoke(long long action,	     enum crmd_fsa_cause cause,	     enum crmd_fsa_state cur_state,	     enum crmd_fsa_input current_input,	     fsa_data_t *msg_data){	enum crmd_fsa_input ret = I_NULL;	HA_Message *cmd = NULL;			if(AM_I_DC == FALSE) {		crm_debug("Not DC: No need to invoke the TE (anymore): %s",			  fsa_action2string(action));		return I_NULL;			} else if(fsa_state != S_TRANSITION_ENGINE && action ^ A_TE_CANCEL) {		crm_debug("No need to invoke the TE (%s) in state %s",			  fsa_action2string(action),			  fsa_state2string(fsa_state));		return I_NULL;			} else if(is_set(fsa_input_register, R_SHUTDOWN)) {		crm_err("No point invoking the TE, we're shutting down");		return I_NULL;	} else if(is_set(fsa_input_register, R_TE_CONNECTED) == FALSE) {		if(te_subsystem->pid > 0) {			int pid_status = -1;			int rc = waitpid(				te_subsystem->pid, &pid_status, WNOHANG);			if(rc > 0 && WIFEXITED(pid_status)) {				clear_bit_inplace(fsa_input_register,						  te_subsystem->flag_connected);					if(is_set(fsa_input_register,					  te_subsystem->flag_required)) {					/* this wasnt supposed to happen */					crm_err("%s[%d] terminated during start",						te_subsystem->name,						te_subsystem->pid);					register_fsa_error(						C_FSA_INTERNAL, I_ERROR, NULL);				}				te_subsystem->pid = -1;				return I_NULL;			}		} 		crm_info("Waiting for the TE to connect before action %s",			fsa_action2string(action));		if(action & A_TE_INVOKE) {			register_fsa_input(				msg_data->fsa_cause, msg_data->fsa_input,				msg_data->data);		}		crmd_fsa_stall(NULL);		return I_NULL;	}	if(action & A_TE_INVOKE) {		ha_msg_input_t *input = fsa_typed_data(fsa_dt_ha_msg);		if(input->xml != NULL) {			CRM_DEV_ASSERT(is_set(fsa_input_register, R_IN_TRANSITION) == FALSE);			crm_debug("Starting a transition");			set_bit_inplace(fsa_input_register, R_IN_TRANSITION);						cmd = create_request(				CRM_OP_TRANSITION, input->xml, NULL,				CRM_SYSTEM_TENGINE, CRM_SYSTEM_DC, NULL);						send_request(cmd, NULL);		} else {			register_fsa_error(C_FSA_INTERNAL, I_FAIL, NULL);		}		} else if(action & A_TE_CANCEL) {		if(is_set(fsa_input_register, R_IN_TRANSITION)) {			crm_debug("Cancelling the active Transition");			cmd = create_request(				CRM_OP_TEABORT, NULL, NULL,				CRM_SYSTEM_TENGINE, CRM_SYSTEM_DC, NULL);						send_request(cmd, NULL);		} else {			register_fsa_action(A_PE_INVOKE);		}	} else if(action & A_TE_HALT) {		cmd = create_request(			CRM_OP_TE_HALT, NULL, NULL,			CRM_SYSTEM_TENGINE, CRM_SYSTEM_DC, NULL);				send_request(cmd, NULL);	}	return ret;}