aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.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.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.h')
-rw-r--r--tools/libxl/libxl.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 25efa76a04..ef96bce1a7 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -273,9 +273,9 @@
#include <libxl_uuid.h>
#include <_libxl_list.h>
-/* API compatibility. Only 0x040200 is supported at this time. */
+/* API compatibility. */
#ifdef LIBXL_API_VERSION
-#if LIBXL_API_VERSION != 0x040200
+#if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300
#error Unknown LIBXL_API_VERSION
#endif
#endif
@@ -308,6 +308,16 @@
*/
#define LIBXL_HAVE_DEVICE_BACKEND_DOMNAME 1
+/*
+ * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+ *
+ * This argument was erroneously "const" in the 4.2 release despite
+ * the requirement for the callback to free the event.
+ */
+#if LIBXL_API_VERSION != 0x040200
+#define LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG 1
+#endif
+
/* Functions annotated with LIBXL_EXTERNAL_CALLERS_ONLY may not be
* called from within libxl itself. Callers outside libxl, who
* do not #include libxl_internal.h, are fine. */