From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAoax-0006ic-Dl for qemu-devel@nongnu.org; Thu, 11 Dec 2008 11:40:59 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAoav-0006gs-Qc for qemu-devel@nongnu.org; Thu, 11 Dec 2008 11:40:59 -0500 Received: from [199.232.76.173] (port=34729 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAoav-0006gi-Lo for qemu-devel@nongnu.org; Thu, 11 Dec 2008 11:40:57 -0500 Received: from mtagate2.de.ibm.com ([195.212.17.162]:55117) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAoav-0004Gz-33 for qemu-devel@nongnu.org; Thu, 11 Dec 2008 11:40:57 -0500 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate2.de.ibm.com (8.13.1/8.13.1) with ESMTP id mBBGepDU018840 for ; Thu, 11 Dec 2008 16:40:51 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBBGeptY3461158 for ; Thu, 11 Dec 2008 17:40:51 +0100 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBBGeomi031491 for ; Thu, 11 Dec 2008 17:40:51 +0100 From: ehrhardt@linux.vnet.ibm.com Date: Thu, 11 Dec 2008 17:40:51 +0100 Message-Id: <1229013651-6200-1-git-send-email-ehrhardt@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH] qemu: report issues causing the kvm probe to fail Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com, qemu-devel@nongnu.org Cc: ehrhardt@linux.vnet.ibm.com, hollisb@us.ibm.com From: Christian Ehrhardt I ran into the issue of a failign KVM Probe of the qemu configure script three times this week always needing "set -x", inserting an exit, masking the cleanup trap and compiling the c file by hand until I knew what the reason is. I think we could make easier for developers and end users. Therefore this patch keeps the qemu style configure output which is a list of "$Feature $Status", but extend the "no" result like "KVM Support no" with some more information. There might be a lot of things going wrong with that probe and I don't want to handle all of them, but if it is one of the known checks e.g. for KVM_API_VERSION then we could grep/awk that out and report it. The patch reports in case of a known case in the style "KVM support no - (Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS)" In case more than one #error is triggered it creates a comma separated list in those brackets and in case it is something else than an #error it just reports plain old "no". I sent a similar patch matching kvm-userspace upstream version of this file to kvm@vger.kernel.org to keep both in sync as much as possible. Signed-off-by: Christian Ehrhardt --- [diffstat] configure | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) [diff] diff --git a/configure b/configure index c534441..416a13b 100755 --- a/configure +++ b/configure @@ -929,14 +929,18 @@ fi if test "$kvm" = "yes" ; then cat > $TMPC < -#if !defined(KVM_API_VERSION) || \ - KVM_API_VERSION < 12 || \ - KVM_API_VERSION > 12 || \ - !defined(KVM_CAP_USER_MEMORY) || \ - !defined(KVM_CAP_SET_TSS_ADDR) || \ - !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS) +#if !defined(KVM_API_VERSION) || KVM_API_VERSION < 12 || KVM_API_VERSION > 12 #error Invalid KVM version #endif +#if !defined(KVM_CAP_USER_MEMORY) +#error Missing KVM capability KVM_CAP_USER_MEMORY +#endif +#if !defined(KVM_CAP_SET_TSS_ADDR) +#error Missing KVM capability KVM_CAP_SET_TSS_ADDR +#endif +#if !defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS) +#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS +#endif int main(void) { return 0; } EOF if test "$kerneldir" != "" ; then @@ -948,7 +952,12 @@ EOF 2>/dev/null ; then : else - kvm="no" + kvmprobeerr=`$cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 | grep "error: #error " | awk --field-separator "error: #error " '{if (NR>1) printf(", "); printf("%s",$2);}'` + if test "$kvmprobeerr" != "" ; then + kvm="no - (${kvmprobeerr})" + else + kvm="no" + fi fi fi