diff mbox

kvm: user: include arch specific headers from $(KERNELDIR)

Message ID 200905141749.54453.arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann May 14, 2009, 3:49 p.m. UTC
On Thursday 14 May 2009, Avi Kivity wrote:
> 
> There aren't the real kernel headers, just cheap copies carried in 
> qemu-kvm.git which have been appropriately postprocessed.  We do this 
> since the kvm external module can run on a much older kernel, so there 
> is no natural place to find it headers.
> 

Sorry for the confusion on my part. I was aware of the sanitized
kernel headers, but was mislead by the line

kerneldir=/lib/modules/$(uname -r)/build

in kvm/user/configure. What I didn't realize is that this
always gets overridden by kvm/configure.
Maybe we can change the default in kvm/user/configure to
something more sensible:
---
[PATCH] kvm: user: fix default kerneldir

calling ./configure in kvm/user sets the kerneldir to the
currently running kernel, which is incorrect for user code.
This changes the default to the sanitized header files from
the kvm/kernel directory.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Avi Kivity May 14, 2009, 3:55 p.m. UTC | #1
Arnd Bergmann wrote:
> On Thursday 14 May 2009, Avi Kivity wrote:
>   
>> There aren't the real kernel headers, just cheap copies carried in 
>> qemu-kvm.git which have been appropriately postprocessed.  We do this 
>> since the kvm external module can run on a much older kernel, so there 
>> is no natural place to find it headers.
>>     
>
> Sorry for the confusion on my part. I was aware of the sanitized
> kernel headers, but was mislead by the line
>
> kerneldir=/lib/modules/$(uname -r)/build
>
> in kvm/user/configure. What I didn't realize is that this
> always gets overridden by kvm/configure.
> Maybe we can change the default in kvm/user/configure to
> something more sensible:
> ---
> [PATCH] kvm: user: fix default kerneldir
>
> calling ./configure in kvm/user sets the kerneldir to the
> currently running kernel, which is incorrect for user code.
> This changes the default to the sanitized header files from
> the kvm/kernel directory.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> diff --git a/kvm/user/configure b/kvm/user/configure
> index efb8705..858a519 100755
> --- a/kvm/user/configure
> +++ b/kvm/user/configure
> @@ -1,7 +1,7 @@
>  #!/bin/bash
>  
>  prefix=/usr/local
> -kerneldir=/lib/modules/$(uname -r)/build
> +kerneldir="$(dirname $0)/../kernel"
>  cc=gcc
>  ld=ld
>  objcopy=objcopy
>   

I usually add a readlink -f in there due to my innate fear of relative 
directories and cd.

btw, these are my plans for kvm/user:

- convert the tests to be loadable with qemu -kernel; we lose the 
simplicity of kvmctl so I'm not 100% sure it's a good idea.  On the 
other hand some of the tests are useful for tcg.
- kill kvmtrace (replaced by the standard ftrace tools, whatever they 
are; maybe create a new repo if kvm specific tools are needed)
Arnd Bergmann May 14, 2009, 4:07 p.m. UTC | #2
On Thursday 14 May 2009, Avi Kivity wrote:
> I usually add a readlink -f in there due to my innate fear of relative 
> directories and cd.

There is one already in the only place where this gets used:

KERNELDIR=$(readlink -f $kerneldir)

It also gets shown in the configure --help output, but I suppose
showing the relative path there may be helpful because of its
brevity.

	Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/kvm/user/configure b/kvm/user/configure
index efb8705..858a519 100755
--- a/kvm/user/configure
+++ b/kvm/user/configure
@@ -1,7 +1,7 @@ 
 #!/bin/bash
 
 prefix=/usr/local
-kerneldir=/lib/modules/$(uname -r)/build
+kerneldir="$(dirname $0)/../kernel"
 cc=gcc
 ld=ld
 objcopy=objcopy