From 2e2581f5748c35434d6db95a0626da6c22d3be8b Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Fri, 4 Dec 2009 16:10:59 +0000 Subject: [PATCH] This puts multiple nodeids on each [QUORUM] Members line instead of putting each nodeid on a separate line. With more than a few nodes the excessive lines become a real nuisance, and anyone up around 32 nodes may literally be scrolling through hundreds of those lines. from David teigland git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2565 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/vsf_quorum.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/exec/vsf_quorum.c b/exec/vsf_quorum.c index bc11d059..453d20aa 100644 --- a/exec/vsf_quorum.c +++ b/exec/vsf_quorum.c @@ -103,6 +103,32 @@ static struct memb_ring_id quorum_ring_id; static size_t quorum_view_list_entries = 0; static int quorum_view_list[PROCESSOR_COUNT_MAX]; struct quorum_services_api_ver1 *quorum_iface = NULL; +static char view_buf[64]; + +static void log_view_list(const unsigned int *view_list, size_t view_list_entries) +{ + int total = (int)view_list_entries; + int len, pos, ret; + int i = 0; + + while (1) { + len = sizeof(view_buf); + pos = 0; + memset(view_buf, 0, len); + + for (; i < total; i++) { + ret = snprintf(view_buf + pos, len - pos, " %d", view_list[i]); + if (ret >= len - pos) + break; + pos += ret; + } + log_printf (LOGSYS_LEVEL_NOTICE, "Members[%d]:%s%s", + total, view_buf, i < total ? "\\" : ""); + + if (i == total) + break; + } +} /* Internal quorum API function */ static void quorum_api_set_quorum(const unsigned int *view_list, @@ -123,9 +149,7 @@ static void quorum_api_set_quorum(const unsigned int *view_list, memcpy(&quorum_ring_id, ring_id, sizeof (quorum_ring_id)); memcpy(quorum_view_list, view_list, sizeof(unsigned int)*view_list_entries); - log_printf (LOGSYS_LEVEL_NOTICE, "Members[%d]: ", (int)view_list_entries); - for (i=0; i