Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-25-2016, 06:19 AM   #1
LQ Newbie
Registered: May 2016
Posts: 3

Rep: Reputation: Disabled
KVM module build on RHEL

I am trying to compile a specific version of kvm module from source for my kernel version. As per for kernel versions >= 2.6.29 any version of kvm can be used.

My kernel version is 2.6.32 and i am trying to compile kvm-kmod 3.10.21 version.
However, during make i ran into following error :

make -C /lib/modules/2.6.32-431.11.2.el6.x86_64/build M=`pwd` \
> LINUXINCLUDE="-I`pwd`/include -I`pwd`/include/uapi -Iinclude \
> -Iinclude2 -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/include -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/include/uapi -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/arch/x86/include -I/lib/modules/2.6.32-431.11.2.el6.x86_64/source/arch/x86/include/uapi \
> -Iinclude/generated/uapi -Iarch/x86/include/generated \
> -Iarch/x86/include/generated/uapi \
> -I`pwd`/include-compat -I`pwd`/x86 \
> -include include/linux/autoconf.h \
> -include `pwd`/x86/external-module-compat.h" \ "$@" make[1]: Entering directory `/usr/src/kernels/2.6.32-431.11.2.el6.x86_64' CC [M]
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/svm.o In file included from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/external-module-compat.h:26,
> from <command-line>:0:
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:731:54:
> error: too many decimal points in number
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:731:74:
> error: operator '-' has no right operand
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:748:55:
> error: too many decimal points in number
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:748:75:
> error: operator '-' has no right operand In file included from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/external-module-compat.h:26,
> from <command-line>:0:
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:758:
> error: static declaration of ‘pci_get_domain_bus_and_slot’ follows
> non-static declaration include/linux/pci.h:763: note: previous
> declaration of ‘pci_get_domain_bus_and_slot’ was here
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:780:
> error: redefinition of ‘struct perf_guest_info_callbacks’
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:787:
> error: conflicting types for ‘perf_register_guest_info_callbacks’
> include/linux/perf_event.h:1164: note: previous declaration of
> ‘perf_register_guest_info_callbacks’ was here
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:793:
> error: conflicting types for ‘perf_unregister_guest_info_callbacks’
> include/linux/perf_event.h:1165: note: previous declaration of
> ‘perf_unregister_guest_info_callbacks’ was here
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:800:1:
> warning: "rcu_dereference_check" redefined In file included from
> include/linux/tracepoint.h:18, from include/linux/module.h:18, from
> include/linux/sysdev.h:25, from include/linux/cpu.h:22, from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/../external-module-compat-comm.h:15,
> from
> /home/user/kvm_build/kvm-kmod-3.10.21/x86/external-module-compat.h:26,
> from <command-line>:0: include/linux/rcupdate.h:257:1: warning: this
> is the location of the previous definition
Am i missing something ?

Last edited by dexter85; 05-25-2016 at 01:53 PM.
Old 05-26-2016, 01:38 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora 34
Posts: 3,738

Rep: Reputation: 1093Reputation: 1093Reputation: 1093Reputation: 1093Reputation: 1093Reputation: 1093Reputation: 1093Reputation: 1093
It looks like you are trying to compile the 3.10.21 version of KVM with the 2.6.32 kernel source. Having backported some drivers in the past I can make some suggestions. Compare the sources between the 2.6.32 KVM and the 3.10.21 KVM. You will need to take out or modify new kernel features and new CONFIG_ options to work properly with the older kernel. One source for descriptions of the differences in each kernel release is You might also consider adding the new features that you need to the older KVM code. I find its generally easier to start from something that works but doesn't do what I want than vice versa.
1 members found this post helpful.
Old 05-26-2016, 02:04 PM   #3
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
There is a warning - somewhere around 2.6.32 (and the 3.x kernels) the kernel VM structure changed. Newer KVM modules won't work without back porting those changes and it may not be possible to do. Some of the changes had to do with how to pass GPU acceleration to the clients securely (as well as access to USB devices...) - and trying to backport that is very likely to fail.

You would have a better chance by using a newer kernel (and yes, you would also have to update some of the kernel support tools as well and maybe, though I don't think so, even rebuild your libc).

Last edited by jpollard; 05-26-2016 at 02:06 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
kvm-qemu-img: qcow2 disk image format changes to raw format in RHEL-KVM 5.6 rajivdp Linux - Virtualization and Cloud 2 09-19-2011 12:23 PM
KVM Build Error 2handband Slackware 3 12-22-2010 11:22 AM
Loading kvm-intel module for qemu-kvm 0.11.0 alkos333 Slackware 6 11-13-2009 11:01 PM
[SOLVED] Build KVM as a module or inside the kernel ? Linux.tar.gz Linux - Software 2 10-05-2009 04:08 AM
RHEL 5 basic build and a Build for Oracle 10g r2 bhoros Linux - Server 2 06-19-2008 04:09 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration