问题
My virtualization project requires me to make changes in the vmx.c file of KVM.I have installed KVM in my Ubuntu 14.04 OS and am done launching an instance too.Yet,when I look up for vmx.c in the system,I do not find it.I though find a vmx.h file in the following directory /usr/src/linux-headers-3.19.0-30/arch/x86/include/asm.It would be really helpful if someone could guide me as to how do I go about it.Thank you in advance!
回答1:
To be able to modify KVM without recompiling all the kernel, you can use Jan Kiszka's repo for building an external KVM module as following:
git clone git://git.kiszka.org/kvm-kmod.git
cd kvm-kmod
git submodule update --init
./configure
make sync
make
You can find after that the files you need in kvm-kmod/x86/
and you can modify them as you need.
To install your modified version you can use run from the kvm-mod
directory:
make
sudo su
rmmod kvm-intel
rmmod kvm
insmod kvm
insmod kvm-intel
You can put these commands in a script file to avoid typing them each time ;)
来源:https://stackoverflow.com/questions/33384340/trouble-trying-to-access-kvm-code-in-ubuntu-14-04