]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: fix build with Xen4.3
authorJim Fehlig <jfehlig@suse.com>
Thu, 16 May 2013 14:42:21 +0000 (08:42 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 15 Jan 2014 19:20:04 +0000 (12:20 -0700)
Xen 4.3 fixes a mistake in the libxl event handler signature where the
event owned by the application was defined as const.  Detect this and
define the libvirt libxl event handler signature appropriately.
(cherry picked from commit 43b0ff5b1eb7fbcdc348b2a53088a7db939d5e48)

Conflicts:
src/libxl/libxl_driver.c - context in formatting

src/libxl/libxl_driver.c

index fa2f3ff2fb3a490777d7c778fdbe9dca55af3591..40538d96d899a6d365507a8ee361679368d1b1dc 100644 (file)
@@ -520,9 +520,22 @@ libxlVmReap(libxlDriverPrivatePtr driver,
 }
 
 /*
- * Handle previously registered event notification from libxenlight
+ * Handle previously registered event notification from libxenlight.
+ *
+ * Note: Xen 4.3 removed the const from the event handler signature.
+ * Detect which signature to use based on
+ * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG.
  */
-static void libxlEventHandler(void *data, const libxl_event *event)
+
+#ifdef LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+# define VIR_LIBXL_EVENT_CONST /* empty */
+#else
+# define VIR_LIBXL_EVENT_CONST const
+#endif
+
+static void
+libxlEventHandler(void *data ATTRIBUTE_UNUSED,
+                  VIR_LIBXL_EVENT_CONST libxl_event *event)
 {
     libxlDriverPrivatePtr driver = libxl_driver;
     virDomainObjPtr vm = data;