aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_event.h
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2013-04-26 12:42:24 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-05-01 13:00:57 +0100
commit5fb11a07023959b6c91f7f37124699681011c03a (patch)
treedda1dea052d3164546608484184a66536d12e14d /tools/libxl/libxl_event.h
parent196f03ab8401830390ae364c607aa81b4253507a (diff)
downloadxen-5fb11a07023959b6c91f7f37124699681011c03a.tar.gz
xen-5fb11a07023959b6c91f7f37124699681011c03a.tar.bz2
xen-5fb11a07023959b6c91f7f37124699681011c03a.zip
libxl: unconst the event argument to the event_occurs hook.
The event is supposed to become owned, and therefore freed, by the application and the const prevents this. Unfortunately there is no way to remove the const without breaking existing callers. The best we can do is use the LIBXL_API_VERSION provisions to remove the const for callers who wish only to support the 4.3 API and newer. Callers who wish to support 4.2 will need to live with casting away the const. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_event.h')
-rw-r--r--tools/libxl/libxl_event.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/libxl/libxl_event.h b/tools/libxl/libxl_event.h
index 51f27218e8..27a65dce92 100644
--- a/tools/libxl/libxl_event.h
+++ b/tools/libxl/libxl_event.h
@@ -64,7 +64,11 @@ void libxl_event_free(libxl_ctx *ctx, libxl_event *event);
typedef struct libxl_event_hooks {
uint64_t event_occurs_mask;
- void (*event_occurs)(void *user, const libxl_event *event);
+ void (*event_occurs)(void *user,
+#ifndef LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+ const
+#endif
+ libxl_event *event);
void (*disaster)(void *user, libxl_event_type type,
const char *msg, int errnoval);
} libxl_event_hooks;