The Virtio devices need to be refactored to use the QOM implementation.
- Name: Fred Konrad
- Email: email@example.com
Actually QEMU has a lot of virtio devices, which are not QOM compliant; they can be used with two different transports:
- PCI: with eg: -device virtio-blk-pci.
- S390: with eg: -device virtio-blk-s390.
The new implementation is as follows:
- A new bus is introduced: virtio-bus which is an abstract bus.
- For each transport a specific implementation of virtio-bus is created. (eg: virtio-pci-bus for virtio-pci).
- Each virtio transport is built with a virtio-bus that the virtio devices connect to.
- VirtIODevice becomes a device which is abstract and must be connected on a virtio-bus.
- Each virtio device are created (eg: virtio-blk) extends VirtioDevice and then connects on a virtio-bus.
As we discussed, we must keep the backward compatibility. So the re-factored device must have the same properties and the same behavior. We should have only one way to create the device, so the transport/virtio-bus/virtio-device layout is only internal to QEMU for S390 and PCI device.
The re-factoring is in three parts, to have smaller patch-set:
- The first part is introduction of virtio-bus (including virtio-pci-bus and virtio-s390-bus), creation of virtio-device, re-factoring of virtio-pci and virtio-s390-device.
- The second part is the re-factoring of all virtio backend.
- The third part is a clean-up patch-set.
For testing just pull the third part, no need to pull the two firsts.