[PATCH 6/6] Support for dynamic nodelist udpu member change

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

 



Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/main.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/exec/main.c b/exec/main.c
index 2c0c716..19bc460 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -576,11 +576,16 @@ static void totem_dynamic_notify(
 	struct totem_ip_address member;
 	int add_new_member = 0;
 	int remove_old_member = 0;
+	char tmp_str[ICMAP_KEYNAME_MAXLEN];
 
-	res = sscanf(key_name, "totem.interface.%u.member.%u", &ring_no, &member_no);
-	if (res != 2)
+	res = sscanf(key_name, "nodelist.node.%u.ring%u%s", &member_no, &ring_no, tmp_str);
+	if (res != 3)
 		return ;
 
+	if (strcmp(tmp_str, "_addr") != 0) {
+		return;
+	}
+
 	if (event == ICMAP_TRACK_ADD && new_val.type == ICMAP_VALUETYPE_STRING) {
 		add_new_member = 1;
 	}
@@ -616,7 +621,7 @@ static void corosync_totem_dynamic_init (void)
 {
 	icmap_track_t icmap_track = NULL;
 
-	icmap_track_add("totem.interface.",
+	icmap_track_add("nodelist.node.",
 		ICMAP_TRACK_ADD | ICMAP_TRACK_DELETE | ICMAP_TRACK_MODIFY | ICMAP_TRACK_PREFIX,
 		totem_dynamic_notify,
 		NULL,
-- 
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