[PATCH 8/8] Finish quorum module support changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Steven Dake <sdake@xxxxxxxxxx>
---
 exec/service.c    |    9 ++++++---
 exec/service.h    |    2 ++
 exec/votequorum.c |   14 +++++---------
 exec/vsf_quorum.c |   46 +++++++---------------------------------------
 4 files changed, 20 insertions(+), 51 deletions(-)

diff --git a/exec/service.c b/exec/service.c
index 787b289..ed2f3fb 100644
--- a/exec/service.c
+++ b/exec/service.c
@@ -99,13 +99,16 @@ static struct default_service default_services[] = {
 		.loader		= wd_get_service_engine_ver0
 	},
 #endif
-#ifdef HAVE_VOTEQUORUM
 	{
-		.name		= "corosync_quorum",
+		.name		= "corosync_votequorum",
 		.ver		= 0,
 		.loader		= votequorum_get_service_engine_ver0
 	},
-#endif
+	{
+		.name		= "corosync_quorum",
+		.ver		= 0,
+		.loader		= vsf_quorum_get_service_engine_ver0
+	},
 	{
 		.name		= "corosync_cmap",
 		.ver		= 0,
diff --git a/exec/service.h b/exec/service.h
index 33d6053..5309174 100644
--- a/exec/service.h
+++ b/exec/service.h
@@ -77,6 +77,8 @@ extern const char *service_stats_rx[SERVICE_HANDLER_MAXIMUM_COUNT][64];
 extern const char *service_stats_tx[SERVICE_HANDLER_MAXIMUM_COUNT][64];
 
 struct corosync_service_engine *votequorum_get_service_engine_ver0 (void);
+struct corosync_service_engine *vsf_quorum_get_service_engine_ver0 (void);
+struct corosync_service_engine *quorum_get_service_handler_ver0 (void);
 struct corosync_service_engine *pload_get_service_engine_ver0 (void);
 struct corosync_service_engine *cfg_get_service_engine_ver0 (void);
 struct corosync_service_engine *evs_get_service_engine_ver0 (void);
diff --git a/exec/votequorum.c b/exec/votequorum.c
index 6e7d852..baf7b8c 100644
--- a/exec/votequorum.c
+++ b/exec/votequorum.c
@@ -161,9 +161,6 @@ struct quorum_pd {
  * Service Interfaces required by service_message_handler struct
  */
 
-static void votequorum_init(struct corosync_api_v1 *api,
-			    quorum_set_quorate_fn_t report);
-
 static void quorum_confchg_fn (
 	enum totem_configuration_type configuration_type,
 	const unsigned int *member_list, size_t member_list_entries,
@@ -300,7 +297,7 @@ struct corosync_service_engine *votequorum_get_service_engine_ver0 (void)
 	return (&quorum_service_handler);
 }
 
-static void votequorum_init(struct corosync_api_v1 *api,
+void votequorum_init(struct corosync_api_v1 *api,
 			    quorum_set_quorate_fn_t report)
 {
 	ENTER();
@@ -325,9 +322,6 @@ static void votequorum_init(struct corosync_api_v1 *api,
 		wait_for_all_status = 1;
 	}
 
-	/* Load the library-servicing part of this module */
-	api->service_link_and_init(api, "corosync_votequorum_iface", 0);
-
 	LEAVE();
 }
 
@@ -962,8 +956,10 @@ static void quorum_confchg_fn (
 	memcpy(&quorum_ringid, ring_id, sizeof(*ring_id));
 
 	if (configuration_type == TOTEM_CONFIGURATION_REGULAR) {
-		set_quorum(quorum_members, quorum_members_entries,
-			   cluster_is_quorate, &quorum_ringid);
+		if (set_quorum) {
+			set_quorum(quorum_members, quorum_members_entries,
+				 cluster_is_quorate, &quorum_ringid);
+		}
 	}
 
 	LEAVE();
diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c
index bef65fd..9a8dd9c 100644
--- a/exec/vsf_quorum.c
+++ b/exec/vsf_quorum.c
@@ -193,7 +193,7 @@ static struct corosync_service_engine quorum_service_handler = {
 	.sync_mode				= CS_SYNC_V1
 };
 
-static struct corosync_service_engine *quorum_get_service_handler_ver0 (void)
+struct corosync_service_engine *vsf_quorum_get_service_engine_ver0 (void)
 {
 	return (&quorum_service_handler);
 }
@@ -253,14 +253,10 @@ static int quorum_exec_init_fn (struct corosync_api_v1 *api)
 	hdb_handle_t q_handle;
 	char *quorum_module;
 	int res;
-	void *quorum_iface_p;
-	void* _start;
-	void* _stop;
 
 #ifdef COROSYNC_SOLARIS
 	logsys_subsys_init();
 #endif
-#ifdef SDAKE
 	corosync_api = api;
 	list_init (&lib_trackers_list);
 	list_init (&internal_trackers_list);
@@ -269,50 +265,22 @@ static int quorum_exec_init_fn (struct corosync_api_v1 *api)
 	 * Tell corosync we have a quorum engine.
 	 */
 	api->quorum_initialize(&callins);
+	primary_designated = 1;
+	quorum_type = 0;
 
 	/*
 	 * Look for a quorum provider
 	 */
 	if (icmap_get_string("quorum.provider", &quorum_module) == CS_OK) {
-		res = lcr_ifact_reference (
-			&q_handle,
-			quorum_module,
-			0,
-			&quorum_iface_p,
-			0);
-
-		if (res == -1) {
-			log_printf (LOGSYS_LEVEL_NOTICE,
-				    "Couldn't load quorum provider %s\n",
-				    quorum_module);
-			free(quorum_module);
-			return (-1);
-		}
-
 		log_printf (LOGSYS_LEVEL_NOTICE,
 			    "Using quorum provider %s\n", quorum_module);
 
-		/*
-		 * Register the log sites with libqb
-		 */
-		_start = lcr_ifact_addr_get(q_handle, "__start___verbose");
-		_stop = lcr_ifact_addr_get(q_handle, "__stop___verbose");
-		qb_log_callsites_register(_start, _stop);
-
-		quorum_iface = (struct quorum_services_api_ver1 *)quorum_iface_p;
-		quorum_iface->init (api, quorum_api_set_quorum);
-		quorum_type = 1;
-		free(quorum_module);
-	}
-	if (!quorum_iface) {
-		/*
-                 * With no quorum provider, we are always quorate
-                 */
-		primary_designated = 1;
-		quorum_type = 0;
+		if (strcmp (quorum_module, "corosync_votequorum") == NULL) {
+			votequorum_init (api, quorum_api_set_quorum);
+			quorum_type = 1;
+		}
 	}
 
-#endif
 	return (0);
 }
 
-- 
1.7.7.5

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux