Skip to content

Introduce virtqueue_get_avail_bytes()

Amit Shah qemu-devel 2 versions – Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/23 patches 1 replyApplied
  2. v1 posting 1/23 patches 2 repliesSuperseded

Patches in v1 posting 2/2 Applied

#Subject and filesSizeRepliesApplied
1/3virtio: use unsigned int for counting bytes in vqhw/virtio.c+1 -10 replies
2/3virtio: Introduce virtqueue_get_avail_bytes()hw/virtio.c hw/virtio.h+25 -80 replies
3/3virtio-serial-bus: let chardev know the exact number of bytes requestedhw/virtio-serial-bus.c+3 -80 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH RESEND 0/3] Introduce virtqueue_get_avail_bytes()

This is a rebased version of the patchset sent earlier.

The current virtqueue_avail_bytes() is a weird API: it's oddly-named:
doesn't tell us what the API is going to do, and also suits just one use-case (that in virtio-net.c).

Introduce virtqueue_get_avail_bytes(), which returns the number of bytes in the vq available for input as well as output. virtqueue_avail_bytes() is made a wrapper around this new function for now. It should be deprecated soon, though.

Doing this will also help with the virtio-rng patch where a VirtQueueElement is popped only to find out what its size is. With this series applied, the popping (and the subsequent save/load of state for migration) isn't necessary.

The virtio-serial-bus code becomes better too, that's patch 3 here.

Please apply,

Amit Shah (3):
virtio: use unsigned int for counting bytes in vq
virtio: Introduce virtqueue_get_avail_bytes()
virtio-serial-bus: let chardev know the exact number of bytes
requested

 hw/virtio-serial-bus.c |   11 +++--------
 hw/virtio.c            |   30 ++++++++++++++++++++++--------
 hw/virtio.h            |    5 ++++-
 3 files changed, 29 insertions(+), 17 deletions(-)
Signature · 1 line
1.7.7.6