Installing kernel headers in kvm-kmod

2009-12-10 Thread Anthony Liguori

QEMU 0.12.0-rc1 does not support KVM
https://bugs.launchpad.net/bugs/494500

Boils down to the fact that 1) we don't include kernel headers in qemu (whereas 
qemu-kvm does) and 2) kvm-kmod does not install those headers on make install.

I think we've discussed (2) as being the preferred solution.  Does everyone 
agree with that?  Anyone care to volunteer to make the change? :-)

Regards,

Anthony Liguori

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


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Avi Kivity

On 12/10/2009 03:07 PM, Anthony Liguori wrote:

QEMU 0.12.0-rc1 does not support KVM
https://bugs.launchpad.net/bugs/494500

Boils down to the fact that 1) we don't include kernel headers in qemu 
(whereas qemu-kvm does) and 2) kvm-kmod does not install those headers 
on make install.


I think we've discussed (2) as being the preferred solution.  Does 
everyone agree with that?  Anyone care to volunteer to make the 
change? :-)




While I definitely agree with (2), for the bug you cite Ubuntu should 
backport KVM_CAP_DESTROY_MEMORY_REGION_WORKS to their kernel (and 
headers).  Distributions shouldn't require kvm-kmod.


--
error compiling committee.c: too many arguments to function

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


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Jan Kiszka
Anthony Liguori wrote:
 QEMU 0.12.0-rc1 does not support KVM
 https://bugs.launchpad.net/bugs/494500
 
 Boils down to the fact that 1) we don't include kernel headers in qemu
 (whereas qemu-kvm does) and 2) kvm-kmod does not install those headers
 on make install.
 
 I think we've discussed (2) as being the preferred solution.  Does
 everyone agree with that?  Anyone care to volunteer to make the change? :-)
 

I've pushed a half-tested approach into kvm-kmod's next branch. Feel
free to test/fix/enhance it.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Avi Kivity

On 12/10/2009 04:50 PM, Arnd Bergmann wrote:

On Thursday 10 December 2009, Jan Kiszka wrote:
   

Anthony Liguori wrote:
 

QEMU 0.12.0-rc1 does not support KVM
https://bugs.launchpad.net/bugs/494500

Boils down to the fact that 1) we don't include kernel headers in qemu
(whereas qemu-kvm does) and 2) kvm-kmod does not install those headers
on make install.

I think we've discussed (2) as being the preferred solution.  Does
everyone agree with that?  Anyone care to volunteer to make the change? :-)

   

I've pushed a half-tested approach into kvm-kmod's next branch. Feel
free to test/fix/enhance it.
 

This would work, but installing to /usr/include/linux/kvm.h will confuse
distro package managers a lot, because that location belongs to the glibc
or libc-linux-headers or some other package already.

If you want to install the headers from kvm-kmod, I would recommend
doing it in a different path, e.g. /usr/include/kvm-kmod/{linux,asm}.
   


Maybe even /usr/local/include/kvm-kmod-$version/, and a symlink 
/usr/local/include/kvm-kmod.



qemu can then add -I/usr/include/kvm-kmod to it's default include
path and get the kvm-kmod version if that's installed or the distro
version otherwise.

It may also be useful to do the equivalent of 'make headers_install'
from the kernel, to remove all #ifdef __KERNEL__ sections and
sparse annotations from the header files, but it should also work
without that.
   


Well, qemu.git needs __user removed.

--
error compiling committee.c: too many arguments to function

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


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Jan Kiszka
Arnd Bergmann wrote:
 On Thursday 10 December 2009, Jan Kiszka wrote:
 Anthony Liguori wrote:
 QEMU 0.12.0-rc1 does not support KVM
 https://bugs.launchpad.net/bugs/494500

 Boils down to the fact that 1) we don't include kernel headers in qemu
 (whereas qemu-kvm does) and 2) kvm-kmod does not install those headers
 on make install.

 I think we've discussed (2) as being the preferred solution.  Does
 everyone agree with that?  Anyone care to volunteer to make the change? :-)

 I've pushed a half-tested approach into kvm-kmod's next branch. Feel
 free to test/fix/enhance it.
 
 This would work, but installing to /usr/include/linux/kvm.h will confuse
 distro package managers a lot, because that location belongs to the glibc
 or libc-linux-headers or some other package already.
 
 If you want to install the headers from kvm-kmod, I would recommend
 doing it in a different path, e.g. /usr/include/kvm-kmod/{linux,asm}.
 qemu can then add -I/usr/include/kvm-kmod to it's default include
 path and get the kvm-kmod version if that's installed or the distro
 version otherwise.

Good point. /usr/include/kvm-kmod would be ok for me unless someone
wants them elsewhere.

 
 It may also be useful to do the equivalent of 'make headers_install'
 from the kernel, to remove all #ifdef __KERNEL__ sections and
 sparse annotations from the header files, but it should also work
 without that.

Yes, I think it's better to let the sync source install those headers
for us, then pick up those cleaned versions, carry them in kvm-kmod in
addition to the existing ones and finally install them.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Arnd Bergmann
On Thursday 10 December 2009, Avi Kivity wrote:
 Maybe even /usr/local/include/kvm-kmod-$version/, and a symlink 
 /usr/local/include/kvm-kmod.

Depends on how fine-grained you want to do the packaging.
Most distributions split packages between code and development
packages. The kvm-kmod code is the kernel module, so you want
to be able to install it for multiple kernels simultaneously.

Building the package only requires one version of the header
and does not depend on the underlying kernel version, only
on the version of the module, so it's reasonable to install only
one version as the -dev package, and have a dependency
in there to match the module version with the header version.

The most complex setup would split the development package
into one per kernel version and/or module version, plus an
extra package for the module version containing only the
symlink. I wouldn't go there.

  It may also be useful to do the equivalent of 'make headers_install'
  from the kernel, to remove all #ifdef __KERNEL__ sections and
  sparse annotations from the header files, but it should also work
  without that.
 
 
 Well, qemu.git needs __user removed.

This one is taken care of by kvm_kmod in the sync script, though it
would be cleaner to only do it for the installed version of the header,
not for the one used to build kvm.ko.

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


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Jan Kiszka
Arnd Bergmann wrote:
 On Thursday 10 December 2009, Avi Kivity wrote:
 Maybe even /usr/local/include/kvm-kmod-$version/, and a symlink 
 /usr/local/include/kvm-kmod.
 
 Depends on how fine-grained you want to do the packaging.
 Most distributions split packages between code and development
 packages. The kvm-kmod code is the kernel module, so you want
 to be able to install it for multiple kernels simultaneously.
 
 Building the package only requires one version of the header
 and does not depend on the underlying kernel version, only
 on the version of the module, so it's reasonable to install only
 one version as the -dev package, and have a dependency
 in there to match the module version with the header version.
 
 The most complex setup would split the development package
 into one per kernel version and/or module version, plus an
 extra package for the module version containing only the
 symlink. I wouldn't go there.

I've just (forced-)pushed the simple version with
/usr/include/kvm-kmod as destination. The user headers are now stored
under usr/include in the kvm-kmod sources and installed from there.

 
 It may also be useful to do the equivalent of 'make headers_install'
 from the kernel, to remove all #ifdef __KERNEL__ sections and
 sparse annotations from the header files, but it should also work
 without that.

 Well, qemu.git needs __user removed.
 
 This one is taken care of by kvm_kmod in the sync script, though it
 would be cleaner to only do it for the installed version of the header,
 not for the one used to build kvm.ko.

It's easy to drop, but I wonder why it was introduced. To allow reusing
the headers for user space?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Avi Kivity

On 12/10/2009 06:42 PM, Jan Kiszka wrote:


I've just (forced-)pushed the simple version with
/usr/include/kvm-kmod as destination. The user headers are now stored
under usr/include in the kvm-kmod sources and installed from there.
   


It's customary to install to /usr/local, not to /usr (qemu does the same).

--
error compiling committee.c: too many arguments to function

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


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Jan Kiszka
Avi Kivity wrote:
 On 12/10/2009 06:42 PM, Jan Kiszka wrote:
 I've just (forced-)pushed the simple version with
 /usr/include/kvm-kmod as destination. The user headers are now stored
 under usr/include in the kvm-kmod sources and installed from there.

 
 It's customary to install to /usr/local, not to /usr (qemu does the same).

Adjusted accordingly. Moreover, I only install the target arch's header now.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Arnd Bergmann
On Thursday 10 December 2009 17:14:40 Jan Kiszka wrote:
 Avi Kivity wrote:
  On 12/10/2009 06:42 PM, Jan Kiszka wrote:
  I've just (forced-)pushed the simple version with
  /usr/include/kvm-kmod as destination. The user headers are now stored
  under usr/include in the kvm-kmod sources and installed from there.
 
  
  It's customary to install to /usr/local, not to /usr (qemu does the same).

Right. Specifically, an install from source should go to /usr/local/include
by default, while a distro package should override the path to go to
/usr/include, which the current version easily allows.

This also means that qemu will have to look in three places now,
/usr/local/include/kvm-kmod, /usr/include/kvm-kmod and /usr/include.
Adding /usr/local/include probably doesn't hurt but should not be
necessary.

 Adjusted accordingly. Moreover, I only install the target arch's header now.

Looks good now.

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


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Avi Kivity

On 12/10/2009 10:26 PM, Arnd Bergmann wrote:

On Thursday 10 December 2009 17:14:40 Jan Kiszka wrote:
   

Avi Kivity wrote:
 

On 12/10/2009 06:42 PM, Jan Kiszka wrote:
   

I've just (forced-)pushed the simple version with
/usr/include/kvm-kmod as destination. The user headers are now stored
under usr/include in the kvm-kmod sources and installed from there.

 

It's customary to install to /usr/local, not to /usr (qemu does the same).
   

Right. Specifically, an install from source should go to /usr/local/include
by default, while a distro package should override the path to go to
/usr/include, which the current version easily allows.

This also means that qemu will have to look in three places now,
/usr/local/include/kvm-kmod, /usr/include/kvm-kmod and /usr/include.
Adding /usr/local/include probably doesn't hurt but should not be
necessary.
   


The only icky bit is that /usr/local/include/kvm-kmod will stick around 
after the user forgets about it and switches to the kernel headers.  I 
don't see a way around it (it's the generic uninstall problem), so I 
think we should just live with it.


--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

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


Re: Installing kernel headers in kvm-kmod

2009-12-10 Thread Anthony Liguori

Avi Kivity wrote:

On 12/10/2009 04:50 PM, Arnd Bergmann wrote:

On Thursday 10 December 2009, Jan Kiszka wrote:
  

Anthony Liguori wrote:


QEMU 0.12.0-rc1 does not support KVM
https://bugs.launchpad.net/bugs/494500

Boils down to the fact that 1) we don't include kernel headers in qemu
(whereas qemu-kvm does) and 2) kvm-kmod does not install those headers
on make install.

I think we've discussed (2) as being the preferred solution.  Does
everyone agree with that?  Anyone care to volunteer to make the 
change? :-)


   

I've pushed a half-tested approach into kvm-kmod's next branch. Feel
free to test/fix/enhance it.
 

This would work, but installing to /usr/include/linux/kvm.h will confuse
distro package managers a lot, because that location belongs to the 
glibc

or libc-linux-headers or some other package already.

If you want to install the headers from kvm-kmod, I would recommend
doing it in a different path, e.g. /usr/include/kvm-kmod/{linux,asm}.
   


Maybe even /usr/local/include/kvm-kmod-$version/, and a symlink 
/usr/local/include/kvm-kmod.


A pkg-config file would be nice.  Then we need no symlink.  Makes qemu 
interaction saner.


Regards,

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