Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 930528 Details for
Bug 1108522
Various small fixes for RHEL 7.1 (corosync rebase)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
quorumtool: Sort output by nodeid
tmp.2i38vWWoEC (text/plain), 2.42 KB, created by
Jan Friesse
on 2014-08-25 14:40:12 UTC
(
hide
)
Description:
quorumtool: Sort output by nodeid
Filename:
MIME Type:
Creator:
Jan Friesse
Created:
2014-08-25 14:40:12 UTC
Size:
2.42 KB
patch
obsolete
>From ddb017fa0e2026ee4f0d05e9bf780898c32c129a Mon Sep 17 00:00:00 2001 >From: Christine Caulfield <ccaulfie@redhat.com> >Date: Fri, 15 Aug 2014 08:18:07 +0100 >Subject: [PATCH] quorumtool: Sort output by nodeid > >corosync-quorumtool prints the node listing by IP address >(as passed back to it from corosync) but this can be >counter-intuitive if the node IDs aren't in the same >order as the IP addresses. This patch sorts the nodes >by node ID so that the output is easier for humans to >parse. > >Signed-off-by: Christine Caulfield <ccaulfie@redhat.com> >Reviewed-By: Jan Friesse <jfriesse@redhat.com> >--- > tools/corosync-quorumtool.c | 24 ++++++++++++++++++++---- > 1 files changed, 20 insertions(+), 4 deletions(-) > >diff --git a/tools/corosync-quorumtool.c b/tools/corosync-quorumtool.c >index 11124b3..a6d6e4a 100644 >--- a/tools/corosync-quorumtool.c >+++ b/tools/corosync-quorumtool.c >@@ -36,6 +36,7 @@ > #include <config.h> > > #include <stdio.h> >+#include <stdlib.h> > #include <string.h> > #include <sys/types.h> > #include <sys/socket.h> >@@ -368,6 +369,20 @@ static void print_uint32_padded(uint32_t value) > print_string_padded(buf); > } > >+static int compare_nodeids(const void *one, const void *two) >+{ >+ const struct votequorum_info *info1 = one; >+ const struct votequorum_info *info2 = two; >+ >+ if (info1->node_id == info2->node_id) { >+ return 0; >+ } >+ if (info1->node_id > info2->node_id) { >+ return 1; >+ } >+ return -1; >+} >+ > static void display_nodes_data(nodeid_format_t nodeid_format, name_format_t name_format) > { > int i, display_qdevice = 0; >@@ -399,11 +414,12 @@ static void display_nodes_data(nodeid_format_t nodeid_format, name_format_t name > } > printf("Name\n"); > >+ qsort(info, g_view_list_entries, sizeof(struct votequorum_info), compare_nodeids); > for (i=0; i < g_view_list_entries; i++) { > if (nodeid_format == NODEID_FORMAT_DECIMAL) { >- print_uint32_padded(g_view_list[i]); >+ print_uint32_padded(info[i].node_id); > } else { >- printf("0x%08x ", g_view_list[i]); >+ printf("0x%08x ", info[i].node_id); > } > if (v_handle) { > int votes = -1; >@@ -426,8 +442,8 @@ static void display_nodes_data(nodeid_format_t nodeid_format, name_format_t name > } > } > } >- printf("%s", node_name(g_view_list[i], name_format)); >- if (g_view_list[i] == our_nodeid) { >+ printf("%s", node_name(info[i].node_id, name_format)); >+ if (info[i].node_id == our_nodeid) { > printf(" (local)"); > } > printf("\n"); >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1108522
:
907995
|
907996
|
907997
|
907998
|
907999
|
908004
|
908111
|
930505
|
930506
|
930507
|
930509
|
930510
|
930511
|
930512
|
930513
|
930514
|
930515
|
930516
|
930517
|
930518
|
930519
|
930527
| 930528 |
930529
|
930530
|
930531
|
930535
|
930536
|
930537
|
930538
|
930539
|
930540
|
931024