[PATCH 1/2] Tweak nodeid warning

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

 



Nodeid warning now appears only when both totem.nodeid and nodelist
nodeid exists. When nodelist nodeid is not defined, totem.nodeid is
used.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/main.c        |    4 ++--
 exec/totemconfig.c |   16 +++++++---------
 exec/totemconfig.h |    2 +-
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/exec/main.c b/exec/main.c
index b33b5c8..158dea9 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -1174,8 +1174,8 @@ int main (int argc, char **argv, char **envp)
 		log_printf (LOGSYS_LEVEL_WARNING, "member section is deprecated.");
 	}
 
-	if (totem_config_warnings & TOTEM_CONFIG_WARNING_NODEID_IGNORED) {
-		log_printf (LOGSYS_LEVEL_WARNING, "nodeid in totem section is deprecated and ignored.");
+	if (totem_config_warnings & TOTEM_CONFIG_WARNING_TOTEM_NODEID_IGNORED) {
+		log_printf (LOGSYS_LEVEL_WARNING, "nodeid appears both in totem section and nodelist. Nodelist one is used.");
 	}
 
 	if (totem_config_warnings != 0) {
diff --git a/exec/totemconfig.c b/exec/totemconfig.c
index 0b7951c..9434673 100644
--- a/exec/totemconfig.c
+++ b/exec/totemconfig.c
@@ -413,10 +413,10 @@ extern int totem_config_read (
 	char tmp_key[ICMAP_KEYNAME_MAXLEN];
 	uint8_t u8;
 	uint16_t u16;
-	uint32_t u32;
 	char *cluster_name = NULL;
 	int i;
 	int local_node_pos;
+	int nodeid_set;
 
 	*warnings = 0;
 
@@ -455,13 +455,7 @@ extern int totem_config_read (
 		free(str);
 	}
 
-	/*
-	 * Get interface node id. This is now deprecated, so set warning
-	 * flag if item exists.
-	 */
-	if (icmap_get_uint32("totem.nodeid", &u32) == CS_OK) {
-		*warnings |= TOTEM_CONFIG_WARNING_NODEID_IGNORED;
-	}
+	icmap_get_uint32("totem.nodeid", &totem_config->node_id);
 
 	totem_config->clear_node_high_bit = 0;
 	if (icmap_get_string("totem.clear_node_high_bit", &str) == CS_OK) {
@@ -637,7 +631,11 @@ extern int totem_config_read (
 			icmap_set_uint32("nodelist.local_node_pos", local_node_pos);
 
 			snprintf(tmp_key, ICMAP_KEYNAME_MAXLEN, "nodelist.node.%u.nodeid", local_node_pos);
-			icmap_get_uint32(tmp_key, &totem_config->node_id);
+
+			nodeid_set = (totem_config->node_id != 0);
+			if (icmap_get_uint32(tmp_key, &totem_config->node_id) == CS_OK && nodeid_set) {
+				*warnings |= TOTEM_CONFIG_WARNING_TOTEM_NODEID_IGNORED;
+			}
 
 			/*
 			 * Make localnode ring0_addr read only, so we can be sure that local
diff --git a/exec/totemconfig.h b/exec/totemconfig.h
index 9af682f..d003f3f 100644
--- a/exec/totemconfig.h
+++ b/exec/totemconfig.h
@@ -45,7 +45,7 @@
 
 #define TOTEM_CONFIG_WARNING_MEMBERS_IGNORED		(1<<1)
 #define TOTEM_CONFIG_WARNING_MEMBERS_DEPRECATED		(1<<2)
-#define TOTEM_CONFIG_WARNING_NODEID_IGNORED		(1<<3)
+#define TOTEM_CONFIG_WARNING_TOTEM_NODEID_IGNORED	(1<<3)
 
 extern int totem_config_read (
 	struct totem_config *totem_config,
-- 
1.7.1

_______________________________________________
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