]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: Use libxentoollog in preference to libxenctrl if available.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 10 Dec 2015 11:38:36 +0000 (11:38 +0000)
committerJim Fehlig <jfehlig@suse.com>
Tue, 15 Dec 2015 22:46:11 +0000 (15:46 -0700)
Upstream Xen is in the process of splitting the (stable API) xtl_*
interfaces out from the (unstable API) libxenctrl library and into a
new (stable API) libxentoollog.

In order to be compatible with Xen both before and after this
transition check for xtl_createlogger_stdiostream in a libxentoollog
library and use it if present. If it is not present assume it is in
libxenctrl.

Compile tested on Xen 4.6 and a development tree with the split in
place.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
configure.ac

index 98cf210b65b2024642a30aa7ef075334bb58ecde..b641cc707b6ab719d3962ebf1c79002757d2f31f 100644 (file)
@@ -883,7 +883,6 @@ if test "$with_libxl" != "no" ; then
     PKG_CHECK_MODULES([LIBXL], [xenlight], [
      LIBXL_FIRMWARE_DIR=`$PKG_CONFIG --variable xenfirmwaredir xenlight`
      LIBXL_EXECBIN_DIR=`$PKG_CONFIG --variable libexec_bin xenlight`
-     LIBXL_LIBS="$LIBXL_LIBS -lxenctrl"
      with_libxl=yes
     ], [LIBXL_FOUND=no])
     if test "$LIBXL_FOUND" = "no"; then
@@ -896,7 +895,7 @@ if test "$with_libxl" != "no" ; then
         LIBS="$LIBS $LIBXL_LIBS"
         AC_CHECK_LIB([xenlight], [libxl_ctx_alloc], [
             with_libxl=yes
-            LIBXL_LIBS="$LIBXL_LIBS -lxenlight -lxenctrl"
+            LIBXL_LIBS="$LIBXL_LIBS -lxenlight"
         ],[
             if test "$with_libxl" = "yes"; then
                 fail=1
@@ -924,6 +923,14 @@ if test "$with_libxl" = "yes"; then
     if test "x$LIBXL_EXECBIN_DIR" != "x"; then
         AC_DEFINE_UNQUOTED([LIBXL_EXECBIN_DIR], ["$LIBXL_EXECBIN_DIR"], [directory containing Xen libexec binaries])
     fi
+    dnl Check if the xtl_* infrastructure is in libxentoollog
+    dnl (since Xen 4.7) if not then assume it is in libxenctrl
+    dnl (as it was for 4.6 and earler)
+    AC_CHECK_LIB([xentoollog], [xtl_createlogger_stdiostream], [
+        LIBXL_LIBS="$LIBXL_LIBS -lxentoollog"
+    ],[
+        LIBXL_LIBS="$LIBXL_LIBS -lxenctrl"
+    ])
 fi
 AM_CONDITIONAL([WITH_LIBXL], [test "$with_libxl" = "yes"])