From e88aebbac77593bdbb479998b2613dc3beaf6ca9 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Thu, 4 Feb 2010 00:13:27 +0000 Subject: [PATCH] move sync_v2_init() into main_service_ready git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2652 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/main.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/exec/main.c b/exec/main.c index 0aab7720..5b50086b 100644 --- a/exec/main.c +++ b/exec/main.c @@ -122,8 +122,6 @@ static struct corosync_api_v1 *api = NULL; static enum cs_sync_mode minimum_sync_mode; -static enum cs_sync_mode minimum_sync_mode; - static int sync_in_process = 1; static hdb_handle_t corosync_poll_handle; @@ -1181,6 +1179,26 @@ static void main_service_ready (void) evil_init (api); corosync_stats_init (); corosync_totem_stats_init (); + if (minimum_sync_mode == CS_SYNC_V2) { + log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to none. Using V2 of the synchronization engine.\n"); + sync_v2_init ( + corosync_sync_v2_callbacks_retrieve, + corosync_sync_completed); + } else + if (minimum_sync_mode == CS_SYNC_V1) { + log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to whitetank. Using V1 and V2 of the synchronization engine.\n"); + sync_register ( + corosync_sync_callbacks_retrieve, + sync_v2_memb_list_determine, + sync_v2_memb_list_abort, + sync_v2_start); + + sync_v2_init ( + corosync_sync_v2_callbacks_retrieve, + corosync_sync_completed); + } + + } int main (int argc, char **argv) @@ -1477,26 +1495,6 @@ int main (int argc, char **argv) &corosync_group, 1); - if (minimum_sync_mode == CS_SYNC_V2) { - log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to none. Using V2 of the synchronization engine.\n"); - sync_v2_init ( - corosync_sync_v2_callbacks_retrieve, - corosync_sync_completed); - } else - if (minimum_sync_mode == CS_SYNC_V1) { - log_printf (LOGSYS_LEVEL_NOTICE, "Compatibility mode set to whitetank. Using V1 and V2 of the synchronization engine.\n"); - sync_register ( - corosync_sync_callbacks_retrieve, - sync_v2_memb_list_determine, - sync_v2_memb_list_abort, - sync_v2_start); - - sync_v2_init ( - corosync_sync_v2_callbacks_retrieve, - corosync_sync_completed); - } - - /* * Drop root privleges to user 'ais' * TODO: Don't really need full root capabilities;