Professional Documents
Culture Documents
2015 Edition
Host
Net Disk
Management for
OpenStack RHEV
datacenters and clouds
Management for
one host libvirt
QMP
Emulation for
one guest QEMU Guest
Intel VMX
Guest/host mode switching
In-kernel
Device emulation
Host kernel kvm.ko
VMXON
VMRESUME
VMLAUNCH
VMEXIT
6 February 16, 2015 | Stefan Hajnoczi
Memory virtualization with Intel EPT
Host
Page
Table
Physical
RAM
open("/dev/kvm")
ioctl(KVM_CREATE_VM)
ioctl(KVM_CREATE_VCPU)
for (;;) {
ioctl(KVM_RUN)
switch (exit_reason) {
case KVM_EXIT_IO: /* ... */
case KVM_EXIT_HLT: /* ... */
}
}
Guest
RAM Unprivileged and isolated using
SELinux for security
Decouples
hardware
emulation from
I/O mechanism
tap L2TPv3 socket
qcow2 raw
Format
QEMU image format, storage migration,
Protocol I/O throttling
VFS Host full file system and block layer
Block layer
QEMU
Request header Device Guest
emulation
Data buffer
Request footer
Guest RAM
kvm.ko
QEMU
Guest
Device
emulation Data buffer
Linux AIO
VFS
Block layer kvm.ko
Physical disk
QEMU
Guest
Device
emulation Request footer
Linux AIO
Interrupt
VFS
Block layer kvm.ko
Physical disk
QEMU
Guest Request header
Data buffer
Request footer
Interrupt
Guest RAM
kvm.ko
http://qemu-project.org/
http://linux-kvm.org/