diff options
author | Jim Fehlig <jfehlig@suse.com> | 2013-05-16 08:42:21 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2014-01-15 11:01:43 -0700 |
commit | e69022b14fef1a364adfffe4756aaa5883262751 (patch) | |
tree | ef856c13e8948d306221bb60f6bcca4b58338e48 | |
parent | bb250de38c906b4eb37b88da44055a324ac06487 (diff) | |
download | libvirt-e69022b14fef1a364adfffe4756aaa5883262751.tar.gz |
libxl: fix build with Xen4.3
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)
-rw-r--r-- | src/libxl/libxl_driver.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 22bd2457cc..bdc8b2695c 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -667,10 +667,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. */ + +#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, const libxl_event *event) +libxlEventHandler(void *data ATTRIBUTE_UNUSED, + VIR_LIBXL_EVENT_CONST libxl_event *event) { libxlDriverPrivatePtr driver = libxl_driver; virDomainObjPtr vm = NULL; |