From 7ee3cbd9eb4c9a6f74061e9a2d0fa6c6fa046b4f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 8 Aug 2007 03:19:38 +0000 Subject: r24275: - setup the connection to the ctdb daemon - disable the brlock ctdb backend for now (This used to be commit b04bcf46e135af597b89994148a28275d29cdba6) --- source4/cluster/ctdb/ctdb_cluster.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4/cluster') diff --git a/source4/cluster/ctdb/ctdb_cluster.c b/source4/cluster/ctdb/ctdb_cluster.c index b7aa52a7eb..8acb794251 100644 --- a/source4/cluster/ctdb/ctdb_cluster.c +++ b/source4/cluster/ctdb/ctdb_cluster.c @@ -42,6 +42,7 @@ struct cluster_messaging_list { struct cluster_state { struct ctdb_context *ctdb; struct cluster_messaging_list *list; + uint32_t vnn; }; @@ -197,6 +198,7 @@ static struct cluster_ops cluster_ctdb_ops = { void cluster_ctdb_init(struct event_context *ev, const char *model) { struct cluster_state *state; + int ret; if (!lp_parm_bool(-1, "ctdb", "enable", False)) { return; @@ -208,17 +210,32 @@ void cluster_ctdb_init(struct event_context *ev, const char *model) state->ctdb = ctdb_init(ev); if (state->ctdb == NULL) goto failed; + ret = ctdb_socket_connect(state->ctdb); + if (ret == -1) { + DEBUG(0,(__location__ " Failed to connect to ctdb socket\n")); + goto failed; + } + + /* get our vnn */ + state->vnn = ctdb_ctrl_getvnn(state->ctdb, timeval_zero(), CTDB_CURRENT_NODE); + if (state->vnn == (uint32_t)-1) { + DEBUG(0,(__location__ " Failed to get ctdb vnn\n")); + goto failed; + } + state->list = NULL; cluster_ctdb_ops.private = state; cluster_set_ops(&cluster_ctdb_ops); +#if 0 /* nasty hack for now ... */ { void brl_ctdb_init_ops(void); brl_ctdb_init_ops(); } +#endif return; -- cgit