Skip to contentSkip to conversation

kvm: Use kvm-kmod headers if available

PATCH Applied Jan Kiszka 4 participants 4 messages Jan 12, 2010 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/2 kvm: Use kvm-kmod headers if available

Since kvm-kmod-2.6.32.2 we have an alternative source for recent KVM kernel headers. Use it when available and not overruled by --kerneldir.

---

Note: This is the upstream version first. qemu-kvm differs in this area, I will post corresponding patches for that tree later.

 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
index 5c056f5..623c30e 100755
@@ -1384,7 +1384,7 @@ EOF
             kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
       fi
   else
-      kvm_cflags=""
+    kvm_cflags=`pkg-config --cflags kvm-kmod 2> /dev/null`
   fi
   if compile_prog "$kvm_cflags" "" ; then
     kvm=yes
#1 lore raw
Quoted 3 lines · Jan Kiszka

Since kvm-kmod-2.6.32.2 we have an alternative source for recent KVM kernel headers. Use it when available and not overruled by --kerneldir.

Would it be possible to turn this into a configure option? Such that I could say ./configure --with-kvm-kmod{=optional/path/to} because otherwise this adds a potential automagical dependency onto kvm-kmod (i.e. if the user had kvm-kmod installed at the time of build but then removed them and went back with their kernel provided version)

Thanks.

Signature · 1 line
Doug Goldstein
#2 lore raw
Quoted 10 lines · Doug Goldstein
Quoted 3 lines · Jan Kiszka

Since kvm-kmod-2.6.32.2 we have an alternative source for recent KVM kernel headers. Use it when available and not overruled by --kerneldir.

Would it be possible to turn this into a configure option? Such that I could say ./configure --with-kvm-kmod{=optional/path/to} because otherwise this adds a potential automagical dependency onto kvm-kmod (i.e. if the user had kvm-kmod installed at the time of build but then removed them and went back with their kernel provided version)

I don't see the problem yet. Either the qemu version built against the previously installed headers will detect during runtime that the loaded kvm support is restricted or even unsuited and handle this properly. Or the user will happen to generate a new qemu which lacks the same features as the installed kvm.

There is only the case that the distribution ships more powerful kvm modules than their kernel headers advertise. But that's a distribution bug we can only solve by filing bug reports there and installing kvm-kmod in the meantime.

Jan

#3 lore raw
In reply to Jan Kiszka
Quoted 5 lines · Jan Kiszka

Since kvm-kmod-2.6.32.2 we have an alternative source for recent KVM kernel headers. Use it when available and not overruled by --kerneldir.

Applied all. Thanks.

Regards,

Anthony Liguori

Quoted 25 lines

---

Note: This is the upstream version first. qemu-kvm differs in this area, I will post corresponding patches for that tree later.

  configure |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
index 5c056f5..623c30e 100755
@@ -1384,7 +1384,7 @@ EOF
              kvm_cflags="$kvm_cflags -I$kerneldir/arch/$cpu/include"
        fi
    else
-      kvm_cflags=""
+    kvm_cflags=`pkg-config --cflags kvm-kmod 2>  /dev/null`
    fi
    if compile_prog "$kvm_cflags" "" ; then
      kvm=yes