virtio: Introduce virtqueue_get_avail_bytes()
commit0d8d7690850eb0cf2b2b60933cf47669a6b6f18f
authorAmit Shah <amit.shah@redhat.com>
Mon, 24 Sep 2012 18:35:15 +0000 (25 00:05 +0530)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 28 Sep 2012 10:16:27 +0000 (28 12:16 +0200)
treeab991cfc0a7b72f27ad4e2e927605e240d353114
parent385ce95d9d060f20870402c8b2b503d0b6ab8af0
virtio: Introduce virtqueue_get_avail_bytes()

The current virtqueue_avail_bytes() is oddly named, and checks if a
particular number of bytes are available in a vq.  A better API is to
fetch the number of bytes available in the vq, and let the caller do
what's interesting with the numbers.

Introduce virtqueue_get_avail_bytes(), which returns the number of bytes
for buffers marked for both, in as well as out.  virtqueue_avail_bytes()
is made a wrapper over this new function.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio.c
hw/virtio.h