diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-08-08 03:19:38 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:01:34 -0500 |
commit | 7ee3cbd9eb4c9a6f74061e9a2d0fa6c6fa046b4f (patch) | |
tree | 29c5e50766ee7e6c758fd5718dc2ccd6cb9b4508 /source4 | |
parent | b7b3e3e0d40f257942ec528cf069b3451caa699f (diff) | |
download | samba-7ee3cbd9eb4c9a6f74061e9a2d0fa6c6fa046b4f.tar.gz samba-7ee3cbd9eb4c9a6f74061e9a2d0fa6c6fa046b4f.tar.bz2 samba-7ee3cbd9eb4c9a6f74061e9a2d0fa6c6fa046b4f.zip |
r24275: - setup the connection to the ctdb daemon
- disable the brlock ctdb backend for now
(This used to be commit b04bcf46e135af597b89994148a28275d29cdba6)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/cluster/ctdb/ctdb_cluster.c | 17 |
1 files changed, 17 insertions, 0 deletions
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; |