* kvm-userspace requires kvm capable kernel headers in default search path of the compiler
@ 2008-12-10 12:50 Christian Ehrhardt
2008-12-12 0:35 ` Hollis Blanchard
0 siblings, 1 reply; 3+ messages in thread
From: Christian Ehrhardt @ 2008-12-10 12:50 UTC (permalink / raw)
To: kvm, kvm-ppc, Hollis Blanchard, Avi Kivity
[-- Attachment #1: Type: text/plain, Size: 2404 bytes --]
Hi everyone,
while running a test when updating kvm-userspace for powerpc I found
that the current kvm userspace requires kvm kernel headers in the
default search path of the used compilers.
I used to update and build in the same kvm-userspace directory for a
while and this one had an old stale kernel/include directory which
fulfilled all the requirements.
While testing my current patch series on a new git clone of
kvm-userspace I wondered why this doesn't work anymore (it worked in my
old directory which also had the updated current source).
I switched to x86 to verify that issue there and I found that eventually
the issue is in the kvm detection "KVM Probe" part of the qemu
configuration in kvm-userspace. It failed not finding kvm headers.
gcc -m32 -o /tmp/qemu-conf--21885-
-I/home/paelzer/Desktop/kvm-userspace/kernel/include
/tmp/qemu-conf--21885-.c
/tmp/qemu-conf--21885-.c:1:23: error: linux/kvm.h: No such file or
directory
/tmp/qemu-conf--21885-.c:3:2: error: #error Invalid KVM version
Looking at the include paths it is worth to note that a current git
clone of kvm-userspace has no kernel/include directory anymore. A few
questions later to some other kvm developers I found that there headers
can be found, but in the default search path of the compiler e.g.
/usr/include. In my environment with an older gcc cross compiler for
powerpc and no up to date linux headers installed for x86 both
architectures failed.
The Solution to that can be done in several ways:
a) we decide that kvm-userspace needs up-to-date kernel headers
installed. And modify the KVM Probe at least to tell the user about this
possible reason when failing instead of silently switching to "KVM
support no".
b) if the user already provide a --kerneldir option to specify where the
right includes can be found we should give those configure checks a
chance to really reach that. Atm it adds the kernel/include path of the
kvm-userspace tree which doesn't exist anymore (except as stale old dir
in a lot of source trees out there).
c) I overlooked something and there is an even better or trivial
approach :-)
Since this could be solved several very different ways I think its worth
a discussion.
As I prefer b) I attached a simple patch example how this could look
like :-).
--
Grüsse / regards,
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization
[-- Attachment #2: fix-qemu-kerneldir-include.diff --]
[-- Type: text/x-diff, Size: 1125 bytes --]
diff --git a/configure b/configure
index 63f956c..f772bae 100755
--- a/configure
+++ b/configure
@@ -3,6 +3,7 @@
prefix=/usr/local
kernelsourcedir=
kerneldir=/lib/modules/$(uname -r)/build
+qemu_kerneldir=
cc=gcc
ld=ld
objcopy=objcopy
@@ -56,6 +57,7 @@ while [[ "$1" = -* ]]; do
;;
--kerneldir)
kerneldir="$arg"
+ qemu_kerneldir="$arg"
;;
--with-patched-kernel)
want_module=
@@ -84,9 +86,12 @@ while [[ "$1" = -* ]]; do
esac
done
-
-#set kenel directory
+#set libkvm kernel directory
libkvm_kerneldir=$(readlink -f kernel)
+# use libkvm_kerneldir for qemu if no kerneldir option was set
+if test "$qemu_kerneldir" = "" ; then
+ qemu_kerneldir=$libkvm_kerneldir
+fi
case $arch in
i?86*|x86_64*)
@@ -123,7 +128,7 @@ fi
--disable-gcc-check \
--extra-cflags="-I $PWD/../libkvm $qemu_cflags" \
--extra-ldflags="-L $PWD/../libkvm $qemu_ldflags" \
- --kerneldir="$libkvm_kerneldir" \
+ --kerneldir="$qemu_kerneldir" \
--prefix="$prefix" \
${cross_prefix:+"--cross-prefix=$cross_prefix"} \
${cross_prefix:+"--cpu=$arch"} "${qemu_opts[@]}"
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: kvm-userspace requires kvm capable kernel headers in default search path of the compiler
2008-12-10 12:50 kvm-userspace requires kvm capable kernel headers in default search path of the compiler Christian Ehrhardt
@ 2008-12-12 0:35 ` Hollis Blanchard
2008-12-14 7:57 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Hollis Blanchard @ 2008-12-12 0:35 UTC (permalink / raw)
To: Christian Ehrhardt; +Cc: kvm, Avi Kivity
On Wed, 2008-12-10 at 13:50 +0100, Christian Ehrhardt wrote:
> Hi everyone,
> while running a test when updating kvm-userspace for powerpc I found
> that the current kvm userspace requires kvm kernel headers in the
> default search path of the used compilers.
You lost me with this mail, but after hitting the problem myself, I
think I can summarize:
% ./configure
KVM support no
% cd kernel; make sync LINUX=/home/hollisb/source/kvm.git; cd ..
% ./configure
KVM support yes
This is building x86 kvm-userspace.git on an x86 host; no
cross-compiling or PowerPC involved.
This seems wrong to me, and also contradicts the "building an external
module with older kernels" directions at
http://kvm.qumranet.com/kvmwiki/Code .
Avi, did something in the build procedure break recently?
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: kvm-userspace requires kvm capable kernel headers in default search path of the compiler
2008-12-12 0:35 ` Hollis Blanchard
@ 2008-12-14 7:57 ` Avi Kivity
0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2008-12-14 7:57 UTC (permalink / raw)
To: Hollis Blanchard; +Cc: Christian Ehrhardt, kvm
Hollis Blanchard wrote:
> You lost me with this mail, but after hitting the problem myself, I
> think I can summarize:
>
> % ./configure
> KVM support no
> % cd kernel; make sync LINUX=/home/hollisb/source/kvm.git; cd ..
> % ./configure
> KVM support yes
>
> This is building x86 kvm-userspace.git on an x86 host; no
> cross-compiling or PowerPC involved.
>
> This seems wrong to me, and also contradicts the "building an external
> module with older kernels" directions at
> http://kvm.qumranet.com/kvmwiki/Code .
>
> Avi, did something in the build procedure break recently?
>
I guess kvm detection changed, or perhaps on your host there are no kvm
headers in /usr/include.
I don't see a way to work around this; before a 'make sync', one cannot
detect kvm support reliably.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-14 7:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 12:50 kvm-userspace requires kvm capable kernel headers in default search path of the compiler Christian Ehrhardt
2008-12-12 0:35 ` Hollis Blanchard
2008-12-14 7:57 ` Avi Kivity
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).