time_t now = time(NULL);
do_state_transition(long long actions,		    enum crmd_fsa_cause cause,		    enum crmd_fsa_state cur_state,		    enum crmd_fsa_state next_state,		    enum crmd_fsa_input current_input,		    fsa_data_t *msg_data){	gboolean clear_recovery_bit = TRUE;	long long tmp = actions;	const char *state_from = fsa_state2string(cur_state);	const char *state_to   = fsa_state2string(next_state);	const char *input      = fsa_input2string(current_input);		time_t now = time(NULL);	if(cur_state == next_state) {		crm_err("%s called in state %s with no transtion",		       __FUNCTION__, state_from);		return A_NOTHING;	}		do_dot_log(DOT_PREFIX"\t%s -> %s [ label=%s cause=%s origin=%s ] // %s",		  state_from, state_to, input, fsa_cause2string(cause),		  msg_data->origin, asctime(localtime(&now)));		crm_info("State transition %s -> %s [ input=%s cause=%s origin=%s ]",		 state_from, state_to, input, fsa_cause2string(cause),		 msg_data->origin);	/* the last two clauses might cause trouble later */	if(election_timeout != NULL	   && next_state != S_ELECTION	   && next_state != S_RELEASE_DC	   && next_state != S_PENDING) {		crm_timer_stop(election_timeout);/* 	} else { *//* 		crm_timer_start(election_timeout); */	}#if 0	if(is_set(fsa_input_register, R_SHUTDOWN)){		set_bit_inplace(tmp, A_DC_TIMER_STOP);	}#endif	if(next_state == S_INTEGRATION) {		set_bit_inplace(tmp, A_INTEGRATE_TIMER_START);	} else {		set_bit_inplace(tmp, A_INTEGRATE_TIMER_STOP);	}		if(next_state == S_FINALIZE_JOIN) {		set_bit_inplace(tmp, A_FINALIZE_TIMER_START);	} else {		set_bit_inplace(tmp, A_FINALIZE_TIMER_STOP);	}		if(next_state != S_PENDING) {		set_bit_inplace(tmp, A_DC_TIMER_STOP);	}	if(next_state != S_ELECTION) {		highest_born_on = 0;	}		switch(next_state) {		case S_PENDING:					case S_ELECTION:			crm_info("Resetting our DC to NULL on transition to %s",				 fsa_state2string(next_state));			crm_free(fsa_our_dc);			fsa_our_dc = NULL;			break;		case S_NOT_DC:			if(is_set(fsa_input_register, R_SHUTDOWN)){				crm_info("(Re)Issuing shutdown request now"					 " that we have a new DC");				set_bit_inplace(tmp, A_SHUTDOWN_REQ);			}			CRM_DEV_ASSERT(fsa_our_dc != NULL);			if(fsa_our_dc == NULL) {				crm_err("Reached S_NOT_DC without a DC"					" being recorded");			}			break;		case S_RECOVERY:			clear_recovery_bit = FALSE;			break;		case S_FINALIZE_JOIN:			if(cause == C_TIMER_POPPED) {				crm_warn("Progressed to state %s after %s",					 fsa_state2string(next_state),					 fsa_cause2string(cause));			}			if(g_hash_table_size(welcomed_nodes) > 0) {				char *msg = crm_strdup(					"  Welcome reply not received from");								crm_warn("%u cluster nodes failed to respond"					 "to the join offer.",					 g_hash_table_size(welcomed_nodes));				g_hash_table_foreach(					welcomed_nodes, ghash_print_node, msg);			} else {				crm_info("All %d cluster nodes "					 "responded to the join offer.",					 g_hash_table_size(integrated_nodes));			}			break;					case S_POLICY_ENGINE:			if(cause == C_TIMER_POPPED) {				crm_warn("Progressed to state %s after %s",					 fsa_state2string(next_state),					 fsa_cause2string(cause));			}						if(g_hash_table_size(finalized_nodes) > 0) {				char *msg = crm_strdup(					"  Confirm not received from");								crm_err("%u cluster nodes failed to confirm"					 " their join.",					 g_hash_table_size(finalized_nodes));				g_hash_table_foreach(					finalized_nodes, ghash_print_node, msg);							} else if(g_hash_table_size(confirmed_nodes)				  == fsa_membership_copy->members_size) {				crm_info("All %u cluster nodes are"					 " eligable to run resources.",					 fsa_membership_copy->members_size);							} else {				crm_warn("Only %u of %u cluster "					 "nodes are eligable to run resources",					 g_hash_table_size(confirmed_nodes),					 fsa_membership_copy->members_size);			}/* 			initialize_join(FALSE); */			break;		case S_STOPPING:		case S_TERMINATE:			/* possibly redundant */			crm_timer_stop(shutdown_timer);			set_bit_inplace(fsa_input_register, R_SHUTDOWN);			break;					case S_IDLE:			dump_rsc_info();			break;					default:			break;	}	if(clear_recovery_bit && next_state != S_PENDING) {		tmp = clear_bit(tmp, A_RECOVER);	} else if(clear_recovery_bit == FALSE) {		tmp = set_bit(tmp, A_RECOVER);	}		if(tmp != actions) {		fsa_dump_actions(actions ^ tmp, "New actions");		actions = tmp;	}	return actions;}