From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNaDV-0007ly-3F for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:57:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNaDU-0007la-Hc for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:57:32 -0500 Received: from [199.232.76.173] (port=39145 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNaDU-0007lU-Dw for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:57:32 -0500 Received: from savannah.gnu.org ([199.232.41.3]:41846 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LNaDU-0002F8-1C for qemu-devel@nongnu.org; Thu, 15 Jan 2009 16:57:32 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LNaDT-0000PH-D5 for qemu-devel@nongnu.org; Thu, 15 Jan 2009 21:57:31 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LNaDT-0000PD-0Q for qemu-devel@nongnu.org; Thu, 15 Jan 2009 21:57:31 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 15 Jan 2009 21:57:31 +0000 Subject: [Qemu-devel] [6334] report issues causing the kvm probe to fail (Christian Ehrhardt) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6334 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6334 Author: aliguori Date: 2009-01-15 21:57:30 +0000 (Thu, 15 Jan 2009) Log Message: ----------- report issues causing the kvm probe to fail (Christian Ehrhardt) The patch applies to upstream qemu as well as kvm-userspace, but since it is the qemu configure script I think it should go to upstream qemu (Anthony) first and with the next merge to kvm-userspace. On the other hand it is the kvm probe so an ack from Avi in case v3 is ok would be reasonable. *updates* v2 - it also reports other errors than just #error preprocessor statements (requested by Avi) v3 - In case awk or grep is not installed it now gracfully (silently) fails still disabling kvm (requested by Anthony) This patch is about reporting more details of the issue if configuring kvm fails. 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 Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/configure Modified: trunk/configure =================================================================== --- trunk/configure 2009-01-15 21:52:11 UTC (rev 6333) +++ trunk/configure 2009-01-15 21:57:30 UTC (rev 6334) @@ -953,14 +953,18 @@ 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 @@ -980,7 +984,16 @@ > /dev/null 2>/dev/null ; then : else - kvm="no" + kvm="no"; + if [ -x "`which awk 2>/dev/null`" ] && \ + [ -x "`which grep 2>/dev/null`" ]; then + kvmerr=`$cc $ARCH_CFLAGS -o $TMPE ${OS_CFLAGS} $kvm_cflags $TMPC 2>&1 \ + | grep "error: " \ + | awk -F "error: " '{if (NR>1) printf(", "); printf("%s",$2);}'` + if test "$kvmerr" != "" ; then + kvm="no - (${kvmerr})" + fi + fi fi fi