enum crmd_fsa_input failed = I_FAIL;
do_lrm_control(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 failed = I_FAIL;	int ret = HA_OK;		if(action & A_LRM_DISCONNECT) {		if(fsa_lrm_conn) {			fsa_lrm_conn->lrm_ops->signoff(fsa_lrm_conn);		}		/* TODO: Clean up the hashtable */	}	if(action & A_LRM_CONNECT) {			crm_trace("LRM: connect...");		monitors = g_hash_table_new(g_str_hash, g_str_equal);		fsa_lrm_conn = ll_lrm_new(XML_CIB_TAG_LRM);			if(NULL == fsa_lrm_conn) {			return failed;		}				crm_trace("LRM: sigon...");		ret = fsa_lrm_conn->lrm_ops->signon(			fsa_lrm_conn, CRM_SYSTEM_CRMD);				if(ret != HA_OK) {			if(++num_lrm_register_fails < max_lrm_register_fails) {				crm_warn("Failed to sign on to the LRM %d"					 " (%d max) times",					 num_lrm_register_fails,					 max_lrm_register_fails);								startTimer(wait_timer);				crmd_fsa_stall();				return I_NULL;			} else {				crm_err("Failed to sign on to the LRM %d"					" (max) times", num_lrm_register_fails);				register_fsa_input(C_FSA_INTERNAL, I_ERROR, NULL);			}		}				crm_trace("LRM: set_lrm_callback...");		ret = fsa_lrm_conn->lrm_ops->set_lrm_callback(			fsa_lrm_conn, lrm_op_callback);				if(ret != HA_OK) {			crm_err("Failed to set LRM callbacks");			return failed;		}		/* TODO: create a destroy handler that causes		 * some recovery to happen		 */		G_main_add_fd(G_PRIORITY_LOW,			      fsa_lrm_conn->lrm_ops->inputfd(fsa_lrm_conn),			      FALSE,			      lrm_dispatch, fsa_lrm_conn,			      default_ipc_connection_destroy);		set_bit_inplace(fsa_input_register, R_LRM_CONNECTED);			}		if(action & ~(A_LRM_CONNECT|A_LRM_DISCONNECT)) {		crm_err("Unexpected action %s in %s",		       fsa_action2string(action), __FUNCTION__);	}				return I_NULL;}