Features/virtio-refactoring

From QEMU
Revision as of 18:57, 15 January 2013 by FredKonrad (talk | contribs) (Created page with '== Summary == Virtio device need to be refactored to use QOM implementation. == Owner == * '''Name:''' Fred Konrad * '''Email:''' fred.konrad@greensocs.com…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Summary

Virtio device need to be refactored to use QOM implementation.

Owner

Details

Actually QEMU have a lot of virtio-device, which are not QOM compliant, and can be used through two transports:

  • PCI: with eg: -device virtio-blk-pci.
  • S390: with eg: -device virtio-blk-s390.

The new implementation should be the following:

  • A new bus is introduced: virtio-bus which is an abstract bus.
  • For each transport: introduce a specific implementation of virtio-bus. (eg: virtio-pci-bus for virtio-pci).
  • Each transport device has a virtio-bus.
  • VirtioDevice become 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.

Status

Item Status Reviewed Tested
Introduce virtio-bus Done yes yes
Create virtio-device Done yes
Introduce virtio-pci-bus Done yes
Refactor virtio-pci Done yes
Introduce virtio-s390-bus Done yes
Refactor virtio-s390-device Done yes
Refactor virtio-blk Done
Refactor virtio-net Done
Refactor virtio-scsi Done
Refactor virtio-balloon Done
Refactor virtio-rng Done
Refactor virtio-serial Done
Refactor virtio-9p Done yes
Clean-up Done

Git

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.

git://git.greensocs.com/qemu_virtio.git virtio_v3_part1

  • The second part is the re-factoring of all virtio backend.

git://git.greensocs.com/qemu_virtio.git virtio_v3_part2

  • The third part is a clean-up patch-set.

git://git.greensocs.com/qemu_virtio.git virtio_v3_part3

For testing just pull the third part, no need to pull the two firsts.