patch attached to fix
regards
-steve
On Wed, 2009-07-01 at 14:01 +0200, Wojtek Meler wrote:
> I've noticed a little API inconsistency. Every corosync service defines
> callbacks which receive handle obtained from initialize function as
> first argument.
> EVS is different - callbacks don't get handles. Without them one is
> forced to use global / thread variables to remember which handle is
> passed to evs_dispatch.
> Is there any chance to fix API in near future?
>
> Regards,
> Wojtek
> ___
> Openais mailing list
> Openais@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/openais
Index: test/evsverify.c
===
--- test/evsverify.c (revision 2332)
+++ test/evsverify.c (working copy)
@@ -55,6 +55,7 @@
static int deliveries = 0;
static void evs_deliver_fn (
+ hdb_handle_t handle,
unsigned int nodeid,
const void *m,
size_t msg_len)
@@ -81,9 +82,10 @@
}
static void evs_confchg_fn (
- unsigned int *member_list, size_t member_list_entries,
- unsigned int *left_list, size_t left_list_entries,
- unsigned int *joined_list, size_t joined_list_entries)
+ hdb_handle_t handle,
+ const unsigned int *member_list, size_t member_list_entries,
+ const unsigned int *left_list, size_t left_list_entries,
+ const unsigned int *joined_list, size_t joined_list_entries)
{
int i;
Index: test/evsbench.c
===
--- test/evsbench.c (revision 2333)
+++ test/evsbench.c (working copy)
@@ -69,6 +69,7 @@
volatile static int alarm_notice = 0;
static void evs_deliver_fn (
+ hdb_handle_t handle,
unsigned int nodeid,
const void *msg,
size_t msg_len)
@@ -76,6 +77,7 @@
}
static void evs_confchg_fn (
+ hdb_handle_t handle,
const unsigned int *member_list, size_t member_list_entries,
const unsigned int *left_list, size_t left_list_entries,
const unsigned int *joined_list, size_t joined_list_entries)
Index: test/testevs.c
===
--- test/testevs.c (revision 2333)
+++ test/testevs.c (working copy)
@@ -48,6 +48,7 @@
static int deliveries = 0;
static void evs_deliver_fn (
+ hdb_handle_t handle,
unsigned int nodeid,
const void *msg,
size_t msg_len)
@@ -59,6 +60,7 @@
}
static void evs_confchg_fn (
+ hdb_handle_t handle,
const unsigned int *member_list, size_t member_list_entries,
const unsigned int *left_list, size_t left_list_entries,
const unsigned int *joined_list, size_t joined_list_entries)
Index: include/corosync/evs.h
===
--- include/corosync/evs.h (revision 2333)
+++ include/corosync/evs.h (working copy)
@@ -36,6 +36,7 @@
#include
#include
#include
+#include
#ifdef __cplusplus
extern "C" {
@@ -67,11 +68,13 @@
};
typedef void (*evs_deliver_fn_t) (
+ hdb_handle_t handle,
unsigned int nodeid,
const void *msg,
size_t msg_len);
typedef void (*evs_confchg_fn_t) (
+ hdb_handle_t handle,
const unsigned int *member_list, size_t member_list_entries,
const unsigned int *left_list, size_t left_list_entries,
const unsigned int *joined_list, size_t joined_list_entries);
Index: lib/evs.c
===
--- lib/evs.c (revision 2332)
+++ lib/evs.c (working copy)
@@ -279,6 +279,7 @@
case MESSAGE_RES_EVS_DELIVER_CALLBACK:
res_evs_deliver_callback = (struct res_evs_deliver_callback *)dispatch_data;
callbacks.evs_deliver_fn (
+handle,
res_evs_deliver_callback->local_nodeid,
&res_evs_deliver_callback->msg,
res_evs_deliver_callback->msglen);
@@ -287,6 +288,7 @@
case MESSAGE_RES_EVS_CONFCHG_CALLBACK:
res_evs_confchg_callback = (struct res_evs_confchg_callback *)dispatch_data;
callbacks.evs_confchg_fn (
+handle,
res_evs_confchg_callback->member_list,
res_evs_confchg_callback->member_list_entries,
res_evs_confchg_callback->left_list,
___
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais