This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cluster Project branch, master, updated. cluster-2.99.05-37-g8a1c6af


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=8a1c6afa6e267803342838b7cb54d5afd1069ccc

The branch, master has been updated
       via  8a1c6afa6e267803342838b7cb54d5afd1069ccc (commit)
      from  f174491f5e9211bcdc21be79b63c4b1bf73766c0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8a1c6afa6e267803342838b7cb54d5afd1069ccc
Author: Christine Caulfield <ccaulfie@redhat.com>
Date:   Tue Jul 1 15:45:53 2008 +0100

    [CMAN] Add a config update callback
    
    Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>

-----------------------------------------------------------------------

Summary of changes:
 cman/daemon/cnxman-socket.h |    1 +
 cman/daemon/commands.c      |    3 +++
 cman/lib/libcman.h          |    8 +++++---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/cman/daemon/cnxman-socket.h b/cman/daemon/cnxman-socket.h
index 40df33b..798fa02 100644
--- a/cman/daemon/cnxman-socket.h
+++ b/cman/daemon/cnxman-socket.h
@@ -92,6 +92,7 @@
 #define EVENT_REASON_STATECHANGE  1
 #define EVENT_REASON_PORTOPENED   2
 #define EVENT_REASON_TRY_SHUTDOWN 3
+#define EVENT_REASON_CONFIG_UPDATE 4
 
 /* Shutdown flags */
 #define SHUTDOWN_ANYWAY           1
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index 175050d..961fc4a 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -1064,6 +1064,7 @@ static void ccsd_timer_fn(void *arg)
 		log_printf(LOG_ERR, "Now got CCS information version %d, continuing\n", config_version);
 		config_error = 0;
 		recalculate_quorum(0, 0);
+		notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
 	}
 }
 
@@ -1561,6 +1562,7 @@ static int valid_transition_msg(int nodeid, struct cl_transmsg *msg)
 			send_reconfigure(us->node_id, RECONFIG_PARAM_CONFIG_VERSION, config_version);
 		}
 		recalculate_quorum(0, 0);
+		notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
 	}
 
 
@@ -1718,6 +1720,7 @@ static void do_reconfigure_msg(void *data)
 			openais_timer_add_duration((unsigned long long)ccsd_poll_interval*1000000, NULL,
 						   ccsd_timer_fn, &ccsd_timer);
 		}
+		notify_listeners(NULL, EVENT_REASON_CONFIG_UPDATE, config_version);
 		break;
 	}
 }
diff --git a/cman/lib/libcman.h b/cman/lib/libcman.h
index ea3d087..82049a7 100644
--- a/cman/lib/libcman.h
+++ b/cman/lib/libcman.h
@@ -43,11 +43,13 @@ typedef void *cman_handle_t;
  * for TRY_SHUTDOWN           arg == 1 for ANYWAY, otherwise 0 (ie if arg == 1 
  * 			      then cman WILL shutdown regardless
  *                            of your response, think of this as advance warning)
+ * for CONFIG_UPDATE          arg will be the new config version
  */
 typedef enum {CMAN_REASON_PORTCLOSED,
 	      CMAN_REASON_STATECHANGE,
               CMAN_REASON_PORTOPENED,
-              CMAN_REASON_TRY_SHUTDOWN} cman_call_reason_t;
+              CMAN_REASON_TRY_SHUTDOWN,
+              CMAN_REASON_CONFIG_UPDATE} cman_call_reason_t;
 
 /*
  * Reason flags for cman_leave
@@ -171,14 +173,14 @@ typedef struct cman_qdev_info {
  * call other cman_* functions while in these two callbacks:
  */
 
-/* Callback routine for a membership event */
+/* Callback routine for a membership or other event */
 typedef void (*cman_callback_t)(cman_handle_t handle, void *privdata, int reason, int arg);
 
 /* Callback routine for data received */
 typedef void (*cman_datacallback_t)(cman_handle_t handle, void *privdata,
 				    char *buf, int len, uint8_t port, int nodeid);
 
-
+/* Callback for nodes joining/leaving */
 typedef void (*cman_confchgcallback_t)(cman_handle_t handle, void *privdata,
 				       unsigned int *member_list, int member_list_entries,
 				       unsigned int *left_list, int left_list_entries,


hooks/post-receive
--
Cluster Project


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]