From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14659 invoked by alias); 30 Jun 2009 08:08:51 -0000 Received: (qmail 14653 invoked by alias); 30 Jun 2009 08:08:51 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE3 - cman: port to the latest corosync API To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 51177a5e1b86b1eb4768f4d593b85d71e190fda3 X-Git-Newrev: cf170452fec28e7f03d1b1f80c28846e6e016a00 From: "Fabio M. Di Nitto" Message-Id: <20090630080821.273E0120383@lists.fedorahosted.org> Date: Tue, 30 Jun 2009 08:08:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00792.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cf170452fec28e7f03d1b1f80c28846e6e016a00 Commit: cf170452fec28e7f03d1b1f80c28846e6e016a00 Parent: 51177a5e1b86b1eb4768f4d593b85d71e190fda3 Author: Fabio M. Di Nitto AuthorDate: Tue Jun 30 10:07:50 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Tue Jun 30 10:07:50 2009 +0200 cman: port to the latest corosync API this requires corosync 0.99 or higher to build and work. Signed-off-by: Fabio M. Di Nitto --- cman/daemon/ais.c | 3 ++- cman/daemon/daemon.c | 5 ++--- cman/daemon/daemon.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c index ffea8c2..dd6037e 100644 --- a/cman/daemon/ais.c +++ b/cman/daemon/ais.c @@ -102,6 +102,7 @@ static struct corosync_service_engine cman_service_handler = { .lib_exit_fn = cman_exit_fn, .exec_init_fn = cman_exec_init_fn, .config_init_fn = NULL, + .sync_mode = CS_SYNC_V1, }; static struct corosync_service_engine *cman_get_handler_ver0(void) @@ -193,7 +194,7 @@ static int cman_exec_init_fn(struct corosync_api_v1 *api) /* An error message will have been written to cman_pipe */ exit(9); } - cman_init(); + cman_init(api); /* Let cman_tool know we are running and our PID */ sprintf(pipe_msg,"SUCCESS: %d", getpid()); diff --git a/cman/daemon/daemon.c b/cman/daemon/daemon.c index cfaea2d..64607cc 100644 --- a/cman/daemon/daemon.c +++ b/cman/daemon/daemon.c @@ -494,13 +494,12 @@ static void sigint_handler(int ignored) quit_threads = 1; } -extern hdb_handle_t corosync_poll_handle; -int cman_init() +int cman_init(struct corosync_api_v1 *api) { int fd; struct sigaction sa; - cs_poll_handle = corosync_poll_handle; + cs_poll_handle = api->poll_handle_get(); barrier_init(); log_printf(LOG_INFO, "CMAN %s (built %s %s) started\n", diff --git a/cman/daemon/daemon.h b/cman/daemon/daemon.h index 4c202ef..49611b1 100644 --- a/cman/daemon/daemon.h +++ b/cman/daemon/daemon.h @@ -4,7 +4,7 @@ extern void set_cman_timeout(int secs); extern void notify_listeners(struct connection *con, int reason, int arg); extern int num_listeners(void); extern void cman_set_realtime(void); -extern int cman_init(void); +extern int cman_init(struct corosync_api_v1 *api); extern int cman_finish(void); extern void notify_confchg(struct sock_header *message);