Changes between Version 13 and Version 14 of qemu


Ignore:
Timestamp:
09/19/2022 05:55:34 AM (20 months ago)
Author:
pierre
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • qemu

    v13 v14  
    269269
    270270== Using Virtio devices ==
    271 Instead of completely emulating existing hardware devices (network interface, block device, GPU, ...), Qemu allows to present virtual devices to the guest, which directly access host's hardware. This allows to get near bare metal performance in virtual machines. Those devices are known as ''virtio'' devices, and the kernel has powerful drivers for them.
     271Instead of completely emulating existing hardware devices (network interface, block device, GPU, ...), qemu allows to present virtual devices to the guest, which directly access host's hardware. This allows to get near bare metal performance in virtual machines. Those devices are known as ''virtio'' devices, and the linux kernel has powerful drivers for them.
    272272
    273273=== Virtio block device ===
     
    276276-blockdev driver=file,node-name=img1,filename=/path/to/image.qcow2
    277277}}}
    278 It just says that you want to access a file name ''/path/to/image.qcow2'', and creates a handle (the "node-name") that the second level of the stack can use. The second level is given by:
     278It just says that you want to access a file named ''/path/to/image.qcow2'', and creates a handle (the "node-name") that the second level of the stack can use. The second level is given by:
    279279{{{
    280280-blockdev driver=qcow2,file=img1,node-name=disk1
     
    284284-device virtio-blk,drive=disk1
    285285}}}
    286 Now that we have the machine we need to enable the appropriate options in the guest kernel (TODO).
     286Now that we have the machine, we need to enable the appropriate options in the guest kernel:
     287{{{
     288Device Drivers  --->
     289  [*] Block devices  --->             CONFIG_BLK_DEV
     290    <*> Virtio block driver           CONFIG_VIRTIO_BLK
     291  SCSI Device support  --->
     292    [*] SCSI low-level drivers  --->  CONFIG_SCSI_LOWLEVEL
     293      <*> virtio-scsi support         CONFIG_SCSI_VIRTIO
     294  [*] Virtio drivers  --->            CONFIG_VIRTIO_MENU
     295    <*> PCI driver for virtio devices CONFIG_VIRTIO_PCI
     296}}}
     297Note that you need first to select CONFIG_VIRTIO_MENU and CONFIG_VIRTIO_PCI so that the other options appear.
     298
     299The last thing to remember is that the virtio drives are named /dev/vdxn by the kernel, where ''x'' is the drive letter and ''n'' the partition number. Don't forget to update your /etc/fstab file and to change the linux command line in grub!
     300
     301=== Virtio GPU ===
     302TODO
    287303
    288304[wiki:Virtualization Up][[br]]