(remove unused cnt variable from previous posting)
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.
Index: vsf_quorum.c
===================================================================
--- vsf_quorum.c (revision 2562)
+++ vsf_quorum.c (working copy)
@@ -103,7 +103,33 @@
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,
size_t view_list_entries,
@@ -123,9 +149,7 @@
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<view_list_entries; i++)
- log_printf (LOGSYS_LEVEL_NOTICE, " %d ", view_list[i]);
+ log_view_list(view_list, view_list_entries);
/* Tell internal listeners */
send_internal_notification();
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais