From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Ehrhardt Subject: [PATCH] [PATCH] qemu: report issues causing the kvm probe to fail Date: Thu, 11 Dec 2008 17:40:54 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: hollisb@us.ibm.com, ehrhardt@linux.vnet.ibm.com, kvm@vger.kernel.org To: avi@redhat.com Return-path: Received: from mtagate8.de.ibm.com ([195.212.29.157]:52973 "EHLO mtagate8.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755973AbYLKQlh (ORCPT ); Thu, 11 Dec 2008 11:41:37 -0500 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id mBBGetwR532918 for ; Thu, 11 Dec 2008 16:40:55 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBBGet3J2748636 for ; Thu, 11 Dec 2008 17:40:55 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBBGes81026588 for ; Thu, 11 Dec 2008 17:40:55 +0100 Sender: kvm-owner@vger.kernel.org List-ID: # HG changeset patch # User Christian Ehrhardt # Date 1229005383 -3600 # Node ID d788f32f8f60f3a0d86ab218459089e5186632ca # Parent f7dc67cd9b74c5d7ad322686e58325f879d93468 [PATCH] qemu: report issues causing the kvm probe to fail 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". Signed-off-by: Christian Ehrhardt --- [diffstat] configure | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) [diff] diff --git a/qemu/configure b/qemu/configure --- a/qemu/configure +++ b/qemu/configure @@ -1037,12 +1037,14 @@ if test "$kvm" = "yes" ; then 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) +#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 int main(void) { return 0; } EOF @@ -1055,7 +1057,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