summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2011-02-25 16:20:34 +0000
committerAlexander Graf <agraf@suse.de>2011-05-08 10:09:59 +0200
commitd5b93ddfefe63d5869a8eb97ea3474867d3b105b (patch)
tree59e371524ce2dc25b9a9940f4a3c811e7d0aef1f /configure
parentce6bc29458e9e0a95da8aa192fc117125132dc2a (diff)
downloadqemu-d5b93ddfefe63d5869a8eb97ea3474867d3b105b.tar.gz
xen: Support new libxc calls from xen unstable.
This patch updates the libxenctrl calls in Qemu to use the new interface, otherwise Qemu wouldn't be able to build against new versions of the library. We check libxenctrl version in configure, from Xen 3.3.0 to Xen unstable. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure67
1 files changed, 65 insertions, 2 deletions
diff --git a/configure b/configure
index 6f75e2eb9f..5df84d24eb 100755
--- a/configure
+++ b/configure
@@ -127,6 +127,7 @@ vnc_jpeg=""
vnc_png=""
vnc_thread="no"
xen=""
+xen_ctrl_version=""
linux_aio=""
attr=""
vhost_net=""
@@ -1180,20 +1181,81 @@ fi
if test "$xen" != "no" ; then
xen_libs="-lxenstore -lxenctrl -lxenguest"
+
+ # Xen unstable
cat > $TMPC <<EOF
#include <xenctrl.h>
#include <xs.h>
-int main(void) { xs_daemon_open(); xc_interface_open(); return 0; }
+#include <stdint.h>
+#include <xen/hvm/hvm_info_table.h>
+#if !defined(HVM_MAX_VCPUS)
+# error HVM_MAX_VCPUS not defined
+#endif
+int main(void) {
+ xc_interface *xc;
+ xs_daemon_open();
+ xc = xc_interface_open(0, 0, 0);
+ xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
+ xc_gnttab_open(NULL, 0);
+ return 0;
+}
EOF
if compile_prog "" "$xen_libs" ; then
+ xen_ctrl_version=410
xen=yes
- libs_softmmu="$xen_libs $libs_softmmu"
+
+ # Xen 4.0.0
+ elif (
+ cat > $TMPC <<EOF
+#include <xenctrl.h>
+#include <xs.h>
+#include <stdint.h>
+#include <xen/hvm/hvm_info_table.h>
+#if !defined(HVM_MAX_VCPUS)
+# error HVM_MAX_VCPUS not defined
+#endif
+int main(void) {
+ xs_daemon_open();
+ xc_interface_open();
+ xc_gnttab_open();
+ xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
+ return 0;
+}
+EOF
+ compile_prog "" "$xen_libs"
+ ) ; then
+ xen_ctrl_version=400
+ xen=yes
+
+ # Xen 3.3.0, 3.4.0
+ elif (
+ cat > $TMPC <<EOF
+#include <xenctrl.h>
+#include <xs.h>
+int main(void) {
+ xs_daemon_open();
+ xc_interface_open();
+ xc_gnttab_open();
+ xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
+ return 0;
+}
+EOF
+ compile_prog "" "$xen_libs"
+ ) ; then
+ xen_ctrl_version=330
+ xen=yes
+
+ # Xen not found or unsupported
else
if test "$xen" = "yes" ; then
feature_not_found "xen"
fi
xen=no
fi
+
+ if test "$xen" = yes; then
+ libs_softmmu="$xen_libs $libs_softmmu"
+ fi
fi
##########################################
@@ -2855,6 +2917,7 @@ if test "$bluez" = "yes" ; then
fi
if test "$xen" = "yes" ; then
echo "CONFIG_XEN=y" >> $config_host_mak
+ echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
fi
if test "$io_thread" = "yes" ; then
echo "CONFIG_IOTHREAD=y" >> $config_host_mak