Blame 0004-configure-detect-presence-of-libxendevicemodel.patch

Daniel P. Berrange 1e96c6
From 85f61ad8c70b51e541745503d650d0e628809c17 Mon Sep 17 00:00:00 2001
Daniel P. Berrange 1e96c6
From: Paul Durrant <paul.durrant@citrix.com>
Daniel P. Berrange 1e96c6
Date: Tue, 7 Mar 2017 10:55:33 +0000
Daniel P. Berrange 1e96c6
Subject: [PATCH 4/6] configure: detect presence of libxendevicemodel
Daniel P. Berrange 1e96c6
Daniel P. Berrange 1e96c6
This patch adds code in configure to set CONFIG_XEN_CTRL_INTERFACE_VERSION
Daniel P. Berrange 1e96c6
to a new value of 490 if libxendevicemodel is present in the build
Daniel P. Berrange 1e96c6
environment.
Daniel P. Berrange 1e96c6
Daniel P. Berrange 1e96c6
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Daniel P. Berrange 1e96c6
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Daniel P. Berrange 1e96c6
Reviewed-by: Anthony Perard <anthony.perard@citrix.com>
Daniel P. Berrange 1e96c6
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Daniel P. Berrange 1e96c6
(cherry picked from commit da8090ccb7735aed5a46ce27dfbe8486cfce61f5)
Daniel P. Berrange 1e96c6
---
Daniel P. Berrange 1e96c6
 configure | 21 ++++++++++++++++++++-
Daniel P. Berrange 1e96c6
 1 file changed, 20 insertions(+), 1 deletion(-)
Daniel P. Berrange 1e96c6
Daniel P. Berrange 1e96c6
diff --git a/configure b/configure
Daniel P. Berrange 1e96c6
index be4d326ae0..092cb7359d 100755
Daniel P. Berrange 1e96c6
--- a/configure
Daniel P. Berrange 1e96c6
+++ b/configure
Daniel P. Berrange 1e96c6
@@ -1989,7 +1989,7 @@ fi
Daniel P. Berrange 1e96c6
 
Daniel P. Berrange 1e96c6
 if test "$xen" != "no" ; then
Daniel P. Berrange 1e96c6
   xen_libs="-lxenstore -lxenctrl -lxenguest"
Daniel P. Berrange 1e96c6
-  xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
Daniel P. Berrange 1e96c6
+  xen_stable_libs="-lxencall -lxenforeignmemory -lxengnttab -lxenevtchn"
Daniel P. Berrange 1e96c6
 
Daniel P. Berrange 1e96c6
   # First we test whether Xen headers and libraries are available.
Daniel P. Berrange 1e96c6
   # If no, we are done and there is no Xen support.
Daniel P. Berrange 1e96c6
@@ -2012,6 +2012,25 @@ EOF
Daniel P. Berrange 1e96c6
   # Xen unstable
Daniel P. Berrange 1e96c6
   elif
Daniel P. Berrange 1e96c6
       cat > $TMPC <
Daniel P. Berrange 1e96c6
+#undef XC_WANT_COMPAT_DEVICEMODEL_API
Daniel P. Berrange 1e96c6
+#define __XEN_TOOLS__
Daniel P. Berrange 1e96c6
+#include <xendevicemodel.h>
Daniel P. Berrange 1e96c6
+int main(void) {
Daniel P. Berrange 1e96c6
+  xendevicemodel_handle *xd;
Daniel P. Berrange 1e96c6
+
Daniel P. Berrange 1e96c6
+  xd = xendevicemodel_open(0, 0);
Daniel P. Berrange 1e96c6
+  xendevicemodel_close(xd);
Daniel P. Berrange 1e96c6
+
Daniel P. Berrange 1e96c6
+  return 0;
Daniel P. Berrange 1e96c6
+}
Daniel P. Berrange 1e96c6
+EOF
Daniel P. Berrange 1e96c6
+      compile_prog "" "$xen_libs -lxendevicemodel $xen_stable_libs"
Daniel P. Berrange 1e96c6
+    then
Daniel P. Berrange 1e96c6
+    xen_stable_libs="-lxendevicemodel $xen_stable_libs"
Daniel P. Berrange 1e96c6
+    xen_ctrl_version=490
Daniel P. Berrange 1e96c6
+    xen=yes
Daniel P. Berrange 1e96c6
+  elif
Daniel P. Berrange 1e96c6
+      cat > $TMPC <
Daniel P. Berrange 1e96c6
 /*
Daniel P. Berrange 1e96c6
  * If we have stable libs the we don't want the libxc compat
Daniel P. Berrange 1e96c6
  * layers, regardless of what CFLAGS we may have been given.
Daniel P. Berrange 1e96c6
-- 
Daniel P. Berrange 1e96c6
2.13.0
Daniel P. Berrange 1e96c6