* [Qemu-devel] [PATCH] qemu: report issues causing the kvm probe to fail v3
@ 2009-01-08 13:54 ehrhardt
2009-01-08 15:28 ` [Qemu-devel] " Avi Kivity
2009-01-08 20:34 ` Anthony Liguori
0 siblings, 2 replies; 5+ messages in thread
From: ehrhardt @ 2009-01-08 13:54 UTC (permalink / raw)
To: aliguori; +Cc: ehrhardt, qemu-devel, avi, kvm
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
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 <ehrhardt@linux.vnet.ibm.com>
---
configure | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/qemu/configure b/qemu/configure
--- a/qemu/configure
+++ b/qemu/configure
@@ -1002,13 +1002,17 @@ if test "$kvm" = "yes" ; then
if test "$kvm" = "yes" ; then
cat > $TMPC <<EOF
#include <linux/kvm.h>
-#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
@@ -1021,7 +1025,16 @@ EOF
> /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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] qemu: report issues causing the kvm probe to fail v3
2009-01-08 13:54 [Qemu-devel] [PATCH] qemu: report issues causing the kvm probe to fail v3 ehrhardt
@ 2009-01-08 15:28 ` Avi Kivity
2009-01-08 20:34 ` Anthony Liguori
1 sibling, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2009-01-08 15:28 UTC (permalink / raw)
To: ehrhardt; +Cc: aliguori, avi, kvm, qemu-devel
ehrhardt@linux.vnet.ibm.com wrote:
> From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
>
> 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.
>
Looks fine from here.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] qemu: report issues causing the kvm probe to fail v3
2009-01-08 13:54 [Qemu-devel] [PATCH] qemu: report issues causing the kvm probe to fail v3 ehrhardt
2009-01-08 15:28 ` [Qemu-devel] " Avi Kivity
@ 2009-01-08 20:34 ` Anthony Liguori
2009-01-09 7:33 ` Christian Ehrhardt
1 sibling, 1 reply; 5+ messages in thread
From: Anthony Liguori @ 2009-01-08 20:34 UTC (permalink / raw)
To: ehrhardt; +Cc: qemu-devel, avi, kvm
ehrhardt@linux.vnet.ibm.com wrote:
> From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
>
> 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 <ehrhardt@linux.vnet.ibm.com>
> ---
>
> configure | 27 ++++++++++++++++++++-------
> 1 file changed, 20 insertions(+), 7 deletions(-)
>
> diff --git a/qemu/configure b/qemu/configure
> --- a/qemu/configure
> +++ b/qemu/configure
>
Please send against upstream QEMU.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] qemu: report issues causing the kvm probe to fail v3
2009-01-08 20:34 ` Anthony Liguori
@ 2009-01-09 7:33 ` Christian Ehrhardt
2009-01-15 21:57 ` Anthony Liguori
0 siblings, 1 reply; 5+ messages in thread
From: Christian Ehrhardt @ 2009-01-09 7:33 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, avi, kvm
[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]
Anthony Liguori wrote:
> ehrhardt@linux.vnet.ibm.com wrote:
>> From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
>>
>> 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 <ehrhardt@linux.vnet.ibm.com>
>> ---
>>
>> configure | 27 ++++++++++++++++++++-------
>> 1 file changed, 20 insertions(+), 7 deletions(-)
>>
>> diff --git a/qemu/configure b/qemu/configure
>> --- a/qemu/configure
>> +++ b/qemu/configure
>>
>
> Please send against upstream QEMU.
>
> Regards,
>
> Anthony Liguori
>
This applies to qemu upstream already when not specifying -p or -p 2 (as
I already tested yesterday before submission).
Well I removed the leading qemu dir manually and updated the -51 lines
offset (attached), should I change more than that (add the leading trunk
maybe, atm I'm just not sure what changes you want) ?
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
[-- Attachment #2: configure_print_kvmissue.diff --]
[-- Type: text/x-diff, Size: 2960 bytes --]
Subject: [PATCH] qemu: report issues causing the kvm probe to fail v3
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
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 <ehrhardt@linux.vnet.ibm.com>
---
configure | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -951,13 +951,17 @@ if test "$kvm" = "yes" ; then
if test "$kvm" = "yes" ; then
cat > $TMPC <<EOF
#include <linux/kvm.h>
-#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
@@ -970,7 +974,16 @@ EOF
> /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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH] qemu: report issues causing the kvm probe to fail v3
2009-01-09 7:33 ` Christian Ehrhardt
@ 2009-01-15 21:57 ` Anthony Liguori
0 siblings, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2009-01-15 21:57 UTC (permalink / raw)
To: Christian Ehrhardt; +Cc: qemu-devel, avi, kvm
>>
> This applies to qemu upstream already when not specifying -p or -p 2
> (as I already tested yesterday before submission).
> Well I removed the leading qemu dir manually and updated the -51 lines
> offset (attached), should I change more than that (add the leading
> trunk maybe, atm I'm just not sure what changes you want) ?
Applied. Thanks.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-15 21:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 13:54 [Qemu-devel] [PATCH] qemu: report issues causing the kvm probe to fail v3 ehrhardt
2009-01-08 15:28 ` [Qemu-devel] " Avi Kivity
2009-01-08 20:34 ` Anthony Liguori
2009-01-09 7:33 ` Christian Ehrhardt
2009-01-15 21:57 ` Anthony Liguori
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).