Am I using virtio for my KVM guest?
In one of my KVM guest, when I typed the following command, I get the following
/sbin/lsmod | grep vi
virtio_balloon 3692 0
So does it mean I am using virtio?
Update:
When I type
cat "/boot/config-`uname -r`" | grep -i vir
I can see
CONFIG_PARAVIRT_GUEST=y
CONFIG_PARAVIRT=y
CONFIG_PARAVIRT_SPINLOCKS=y
CONFIG_PARAVIRT_CLOCK=y
# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_VIRT_TO_BUS=y
CONFIG_NET_9P_VIRTIO=m
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_CONSOLE=m
CONFIG_HW_RANDOM_VIRTIO=m
CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
# CONFIG_FB_VIRTUAL is not set
CONFIG_SND_VIRMIDI=m
CONFIG_SND_VIRTUOSO=m
# CONFIG_DEBUG_VIRTUAL is not set
CONFIG_VIRTUALIZATION=y
CONFIG_VIRTIO=y
CONFIG_VIRTIO_RING=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=m
So sound like I am using virtio already?
KVM provides paravirtualization drivers for several bits of hardware; this particular one is the memory balloon driver.
In particular, you should see virtio_net
when using the virtio network drivers, and virtio_blk
when using the block device (disk) driver. And in the latter case, your disk would be /dev/vda
instead of /dev/sda
.
In your case, the virtio disk and network drivers are compiled into the kernel, rather than as modules, so you would not see them with lsmod
.
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=y
Several other less important virtio drivers also exist on your system and are compiled directly into the kernel (such as VIRTIO_PCI, the paravirtualized PCI bus).
As you can see you have:
CONFIG_VIRTIO_BALLOON=m
It means it is compiled as a module, hence visible via lsmod. Furthermore, you have:
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=y
It means that they are compiled within the kernel, hence lsmod does not report them.
So your guest has the virtio drivers for:
- blk: block devices, aka disks;
- net: network devices;
- balloon: memory ballooning, the fact that you could have a total maximum memory allocated to all your guest bigger that the physical host memory. This works of course as long as not all guests consume all their respective memory. KVM uses the unused memory of one guest to feed another more demanding guest, aka balloon.
- pci: I guess PCI passthrough support, though I am not sure. With VirtualBox, ethernet controllers exposed to the guest are using this driver instead of the virtio_net one.
- console: You can configure a serial console in KVM. This can be accesses by virsh concole domain. A great feature (for Linux guests). You have nearly complete access to the VM even without VNC (thus with minimal bandwidth and C&P available) when the network has crashed, preventing SSH access.
- ring: don't know what this is