]> xenbits.xensource.com Git - qemu-upstream-4.2-testing.git/commitdiff
xen,configure: detect Xen 4.2
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 17 Apr 2012 17:04:18 +0000 (17:04 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 27 Jun 2012 10:10:35 +0000 (10:10 +0000)
Xen 4.2 is the first to support xc_hvm_inject_msi: use it to determine
if we are running on it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
configure

index 85e80ca9dd87bdf8679f6be9de85625771824c66..9e0ea7869d222a52f17c3d92d370d92db7feced3 100755 (executable)
--- a/configure
+++ b/configure
@@ -1320,6 +1320,31 @@ if test "$xen" != "no" ; then
 #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);
+  xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
+  xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
+  return 0;
+}
+EOF
+      compile_prog "" "$xen_libs"
+    ) ; then
+    xen_ctrl_version=420
+    xen=yes
+
+  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) {
   xc_interface *xc;
   xs_daemon_open();