Skip to content

virtio: cleanup layout assumptions

Michael S. Tsirkin qemu-devel 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 0 repliesNew
  2. v15 patches 2 repliesSuperseded

Changes in v2 from the cover letter

Get rid of VIRTIO_COMMON_INIT macro:
simple function call, no magic now.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5virtio: add type safe APIhw/virtio-balloon.c hw/virtio-blk.c hw/virtio-net.c +3 more+18 -230 replies
2/5virtio-net: remove layout assumptionshw/virtio-net.c+2 -20 replies
3/5virtio-serial: remove struct layout assumptionshw/virtio-serial-bus.c+4 -40 replies
4/5virtio-balloon: remove layout assumptionshw/virtio-balloon.c+2 -20 replies
5/5virtio-blk: remove layout assumptionhw/virtio-blk.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCHv2 0/5] virtio: cleanup layout assumptions

This patchset helps remove the assumption that vdev must be the 1st member in any virtio device implementation. Other assumptions (made by qdev) can be removed in a similar way separately, this patchset does not do this yet.

We also make it obvious that all of device structure is zero initialized, which devices seem to rely on, by virtue of calling mallocz directly in device code.

Note how code is simplified rather than made more complex.

Changes from v1:
Get rid of VIRTIO_COMMON_INIT macro:
simple function call, no magic now.

Michael S. Tsirkin (5):
virtio: add type safe API
virtio-net: remove layout assumptions
virtio-serial: remove struct layout assumptions
virtio-balloon: remove layout assumptions
virtio-blk: remove layout assumption

 hw/virtio-balloon.c    |   10 ++++------
 hw/virtio-blk.c        |    9 ++++-----
 hw/virtio-net.c        |   11 +++++------
 hw/virtio-serial-bus.c |   17 ++++++++---------
 hw/virtio.c            |    7 +++----
 hw/virtio.h            |    5 +++--
 6 files changed, 27 insertions(+), 32 deletions(-)