qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC 0/4] virtio-mmio transport


From: Peter Maydell
Subject: [Qemu-devel] [RFC 0/4] virtio-mmio transport
Date: Mon, 14 Nov 2011 14:55:24 +0000

This set of patches implements the QEMU end of the MMIO virtio transport
(as specified by Appendix X of the latest virtio spec from here
http://ozlabs.org/~rusty/virtio-spec/virtio.pdf
and implemented by patches which I think are going into Linux 3.2).

I submit this only as an RFC because although it works (tested
virtio-blk anyway) it has some issues:
 * extra vring alignment field not saved/restored (because virtio
   layer isn't using VMState and doesn't allow the virtio base layer
   to specify a version for its data so back-compat would be tricky)
 * you have to specify which kind of virtio device you want in the
   board model. In particular this means that for virtio-blk the user
   has to say "-drive if=none,file=whatever.img,id=myimg 
   -global virtio-blk-mmio.drive=myimg" or the virtio-blk layer will
   refuse to start, which is not at all userfriendly

Anthony's suggestion was that we should have a qdev bus between
the transport layer and the -blk/-net/-etc parts. Then the board could
instantiate N virtio-mmio transport instances, and the user uses
-device to create a virtio-blk device and assign it to the relevant
slot. (PCI virtio would also split similarly so you'd end up with
pci-controller -> n lots of [ virtio-pci-transport + virtio-blk])
plus some syntactic sugar for back-compatibility I guess.)

However I'm not currently sure when I'll have time to do that
refactoring, so I'm just sending this patchset out as an RFC
for now.

Peter Maydell (4):
  virtio: Add support for guest setting of queue size
  virtio: Support transports which can specify the vring alignment
  Add MMIO based virtio transport
  hw/vexpress.c: Add MMIO virtio transport

 Makefile.objs    |    1 +
 hw/vexpress.c    |    3 +
 hw/virtio-mmio.c |  426 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/virtio.c      |   20 +++-
 hw/virtio.h      |    2 +
 5 files changed, 450 insertions(+), 2 deletions(-)
 create mode 100644 hw/virtio-mmio.c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]