qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Stefan Weil <sw@weilnetz.de>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [Qemu-devel] [PATCH 17/17] configure: Improve Xen autodetection for hosts without Xen
Date: Mon, 19 Dec 2011 11:12:38 +0000	[thread overview]
Message-ID: <1324293158-25433-18-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1324293158-25433-1-git-send-email-stefanha@linux.vnet.ibm.com>

From: Stefan Weil <sw@weilnetz.de>

With this patch, it only takes one test (instead of four)
to detect that there is no Xen support at all.

For most build hosts, this will reduce the time configure needs.
It will also reduce noisy output in config.log.

Build hosts with Xen now need up to five (instead of up to four)
tests. They get improved diagnostics when Xen support fails.

Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 configure |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 36ee849..640e815 100755
--- a/configure
+++ b/configure
@@ -1317,10 +1317,30 @@ fi
 if test "$xen" != "no" ; then
   xen_libs="-lxenstore -lxenctrl -lxenguest"
 
-  # Xen unstable
+  # First we test whether Xen headers and libraries are available.
+  # If no, we are done and there is no Xen support.
+  # If yes, more tests are run to detect the Xen version.
+
+  # Xen (any)
   cat > $TMPC <<EOF
 #include <xenctrl.h>
 #include <xs.h>
+int main(void) {
+  return 0;
+}
+EOF
+  if ! compile_prog "" "$xen_libs" ; then
+    # Xen not found
+    if test "$xen" = "yes" ; then
+      feature_not_found "xen"
+    fi
+    xen=no
+
+  # Xen unstable
+  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)
@@ -1336,7 +1356,8 @@ int main(void) {
   return 0;
 }
 EOF
-  if compile_prog "" "$xen_libs" ; then
+      compile_prog "" "$xen_libs"
+    ) ; then
     xen_ctrl_version=410
     xen=yes
 
@@ -1407,10 +1428,10 @@ EOF
     xen_ctrl_version=330
     xen=yes
 
-  # Xen not found or unsupported
+  # Xen version unsupported
   else
     if test "$xen" = "yes" ; then
-      feature_not_found "xen"
+      feature_not_found "xen (unsupported version)"
     fi
     xen=no
   fi
-- 
1.7.7.3

  parent reply	other threads:[~2011-12-19 11:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19 11:12 [Qemu-devel] [PULL 00/17] Trivial patches for 7 to 19 December 2011 Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 01/17] ide: drop argument to dma_buf_commit Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 02/17] Makefile.target: Remove unnecessary dependency rules Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 03/17] stellaris: Calculate system clock period on reset Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 04/17] kvm: Print something before calling abort() if KVM_RUN fails Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 05/17] slirp: Fix typo in net_slirp_hostfwd_remove Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 06/17] Also create piix3 property when Xen is enabled Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 07/17] configure: Fix compiler warnings in config.log (always return a value from main) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 08/17] configure: Fix compiler warnings in config.log (old-style function definition) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 09/17] configure: Fix compiler warning in config.log (integer from pointer) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 10/17] configure: Fix compiler warnings in config.log (null arguments) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 11/17] configure: Fix compiler warning in config.log (unused variable) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 12/17] configure: Fix compiler warning in config.log (macro redefined) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 13/17] configure: Fix compiler warnings in config.log (uninitialized variable) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 14/17] configure: Fix compiler warning in config.log (undefined NULL) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 15/17] configure: Fix compiler warning in config.log (value was never used) Stefan Hajnoczi
2011-12-19 11:12 ` [Qemu-devel] [PATCH 16/17] configure: Fix compiler warnings in config.log (statement without effect) Stefan Hajnoczi
2011-12-19 11:12 ` Stefan Hajnoczi [this message]
2011-12-19 15:44 ` [Qemu-devel] [PULL 00/17] Trivial patches for 7 to 19 December 2011 Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324293158-25433-18-git-send-email-stefanha@linux.vnet.ibm.com \
    --to=stefanha@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).