public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: "Fabio M. Di Nitto" <fabbione@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE3 - cman: port to the latest corosync API
Date: Tue, 30 Jun 2009 08:08:00 -0000	[thread overview]
Message-ID: <20090630080821.273E0120383@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cf170452fec28e7f03d1b1f80c28846e6e016a00
Commit:        cf170452fec28e7f03d1b1f80c28846e6e016a00
Parent:        51177a5e1b86b1eb4768f4d593b85d71e190fda3
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Tue Jun 30 10:07:50 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
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 <fdinitto@redhat.com>
---
 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);
 


                 reply	other threads:[~2009-06-30  8:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090630080821.273E0120383@lists.fedorahosted.org \
    --to=fabbione@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).