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 930535 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]
votequorum: Return current ring id in callback
tmp.eQdcz1iABQ (text/plain), 6.46 KB, created by
Jan Friesse
on 2014-08-25 14:43:31 UTC
(
hide
)
Description:
votequorum: Return current ring id in callback
Filename:
MIME Type:
Creator:
Jan Friesse
Created:
2014-08-25 14:43:31 UTC
Size:
6.46 KB
patch
obsolete
>From 5f6f68805c48f8f72f66f7fff9abc44b4c65df1e Mon Sep 17 00:00:00 2001 >From: Jan Friesse <jfriesse@redhat.com> >Date: Tue, 29 Jul 2014 16:39:10 +0200 >Subject: [PATCH] votequorum: Return current ring id in callback > >Returning ring id will be used in poll function. > >Signed-off-by: Jan Friesse <jfriesse@redhat.com> >Reviewed-by: Christine Caulfield <ccaulfie@redhat.com> >--- > cts/agents/votequorum_test_agent.c | 1 + > exec/votequorum.c | 3 +++ > include/corosync/ipc_votequorum.h | 14 ++++++++++++++ > include/corosync/votequorum.h | 6 ++++++ > lib/votequorum.c | 3 +++ > man/votequorum_initialize.3.in | 5 +++++ > test/testvotequorum1.c | 3 +++ > 7 files changed, 35 insertions(+), 0 deletions(-) > >diff --git a/cts/agents/votequorum_test_agent.c b/cts/agents/votequorum_test_agent.c >index e460f25..c61a4af 100644 >--- a/cts/agents/votequorum_test_agent.c >+++ b/cts/agents/votequorum_test_agent.c >@@ -61,6 +61,7 @@ static void votequorum_notification_fn( > votequorum_handle_t handle, > uint64_t context, > uint32_t quorate, >+ votequorum_ring_id_t ring_id, > uint32_t node_list_entries, > votequorum_node_t node_list[]) > { >diff --git a/exec/votequorum.c b/exec/votequorum.c >index d365147..54b6fbe 100644 >--- a/exec/votequorum.c >+++ b/exec/votequorum.c >@@ -49,6 +49,7 @@ > #include <corosync/logsys.h> > #include <corosync/coroapi.h> > #include <corosync/icmap.h> >+#include <corosync/votequorum.h> > #include <corosync/ipc_votequorum.h> > > #include "service.h" >@@ -1677,6 +1678,8 @@ static int votequorum_exec_send_quorum_notification(void *conn, uint64_t context > res_lib_votequorum_notification = (struct res_lib_votequorum_notification *)&buf; > res_lib_votequorum_notification->quorate = cluster_is_quorate; > res_lib_votequorum_notification->node_list_entries = cluster_members; >+ res_lib_votequorum_notification->ring_id.nodeid = quorum_ringid.rep.nodeid; >+ res_lib_votequorum_notification->ring_id.seq = quorum_ringid.seq; > res_lib_votequorum_notification->context = context; > list_iterate(tmp, &cluster_members_list) { > node = list_entry(tmp, struct cluster_node, list); >diff --git a/include/corosync/ipc_votequorum.h b/include/corosync/ipc_votequorum.h >index c7bb3ed..0fdcd8b 100644 >--- a/include/corosync/ipc_votequorum.h >+++ b/include/corosync/ipc_votequorum.h >@@ -61,6 +61,11 @@ enum res_votequorum_types { > MESSAGE_RES_VOTEQUORUM_EXPECTEDVOTES_NOTIFICATION > }; > >+struct mar_votequorum_ring_id { >+ mar_uint32_t nodeid; >+ mar_uint64_t seq; >+}; >+ > struct req_lib_votequorum_qdevice_register { > struct qb_ipc_request_header header __attribute__((aligned(8))); > char name[VOTEQUORUM_QDEVICE_MAX_NAME_LEN]; >@@ -157,6 +162,7 @@ struct res_lib_votequorum_notification { > struct qb_ipc_response_header header __attribute__((aligned(8))); > mar_uint32_t quorate __attribute__((aligned(8))); > mar_uint64_t context __attribute__((aligned(8))); >+ struct mar_votequorum_ring_id ring_id __attribute__((aligned(8))); > mar_uint32_t node_list_entries __attribute__((aligned(8))); > struct votequorum_node node_list[] __attribute__((aligned(8))); > }; >@@ -167,4 +173,12 @@ struct res_lib_votequorum_expectedvotes_notification { > mar_uint32_t expected_votes __attribute__((aligned(8))); > }; > >+static inline void marshall_from_mar_votequorum_ring_id ( >+ votequorum_ring_id_t *dest, >+ const struct mar_votequorum_ring_id *src) >+{ >+ dest->nodeid = src->nodeid; >+ dest->seq = src->seq; >+}; >+ > #endif >diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h >index c85f281..bba964b 100644 >--- a/include/corosync/votequorum.h >+++ b/include/corosync/votequorum.h >@@ -81,10 +81,16 @@ typedef struct { > uint32_t state; > } votequorum_node_t; > >+typedef struct { >+ uint32_t nodeid; >+ uint64_t seq; >+} votequorum_ring_id_t; >+ > typedef void (*votequorum_notification_fn_t) ( > votequorum_handle_t handle, > uint64_t context, > uint32_t quorate, >+ votequorum_ring_id_t ring_id, > uint32_t node_list_entries, > votequorum_node_t node_list[]); > >diff --git a/lib/votequorum.c b/lib/votequorum.c >index 56ac517..20843cf 100644 >--- a/lib/votequorum.c >+++ b/lib/votequorum.c >@@ -438,6 +438,7 @@ cs_error_t votequorum_dispatch ( > struct res_lib_votequorum_notification *res_lib_votequorum_notification; > struct res_lib_votequorum_expectedvotes_notification *res_lib_votequorum_expectedvotes_notification; > char dispatch_buf[IPC_DISPATCH_SIZE]; >+ votequorum_ring_id_t ring_id; > > if (dispatch_types != CS_DISPATCH_ONE && > dispatch_types != CS_DISPATCH_ALL && >@@ -507,10 +508,12 @@ cs_error_t votequorum_dispatch ( > break; > } > res_lib_votequorum_notification = (struct res_lib_votequorum_notification *)dispatch_data; >+ marshall_from_mar_votequorum_ring_id (&ring_id, &res_lib_votequorum_notification->ring_id); > > callbacks.votequorum_notify_fn ( handle, > res_lib_votequorum_notification->context, > res_lib_votequorum_notification->quorate, >+ ring_id, > res_lib_votequorum_notification->node_list_entries, > (votequorum_node_t *)res_lib_votequorum_notification->node_list ); > ; >diff --git a/man/votequorum_initialize.3.in b/man/votequorum_initialize.3.in >index 64b78de..ee966a8 100644 >--- a/man/votequorum_initialize.3.in >+++ b/man/votequorum_initialize.3.in >@@ -64,6 +64,11 @@ typedef void (*votequorum_notification_fn_t) ( > ); > > .fi >+ >+Current ring_id (one get in votequorum_notification_fn) must be passed to >+.B votequorum_qdevice_poll >+to make qdevice voting valid. >+ > .PP > Every time the expected votes are changed, the callback is called. > The expected votes callback function is described by the following type definitions: >diff --git a/test/testvotequorum1.c b/test/testvotequorum1.c >index 0e443c3..87547ae 100644 >--- a/test/testvotequorum1.c >+++ b/test/testvotequorum1.c >@@ -35,6 +35,7 @@ > #include <config.h> > > #include <sys/types.h> >+#include <inttypes.h> > #include <stdio.h> > #include <string.h> > #include <stdint.h> >@@ -79,6 +80,7 @@ static void votequorum_notification_fn( > votequorum_handle_t handle, > uint64_t context, > uint32_t quorate, >+ votequorum_ring_id_t ring_id, > uint32_t node_list_entries, > votequorum_node_t node_list[] > ) >@@ -88,6 +90,7 @@ static void votequorum_notification_fn( > printf("votequorum notification called \n"); > printf(" quorate = %d\n", quorate); > printf(" number of nodes = %d\n", node_list_entries); >+ printf(" current ringid = (%u.%"PRIu64")\n", ring_id.nodeid, ring_id.seq); > > for (i = 0; i< node_list_entries; i++) { > printf(" %d: %s\n", node_list[i].nodeid, node_state(node_list[i].state)); >-- >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