libqos/virtio: return length written into used descriptor
commitbe3a6781605803b2c48a48135002869ed2c73cf1
authorGreg Kurz <groug@kaod.org>
Thu, 1 Feb 2018 20:21:28 +0000 (1 21:21 +0100)
committerGreg Kurz <groug@kaod.org>
Fri, 2 Feb 2018 10:11:55 +0000 (2 11:11 +0100)
tree1836053f31ca3c79b0901fb08dff53ab12ede27a
parent354b86f85f516fecb60185f9c2b8e5933177b300
libqos/virtio: return length written into used descriptor

When a 9p request is flushed (ie, cancelled) by the guest, the device
is expected to simply mark the request as used, without sending a 9p
reply (ie, without writing anything into the used buffer).

To be able to test this, we need access to the length written by the
device into the used descriptor. This patch adds a uint32_t * argument
to qvirtqueue_get_buf() and qvirtio_wait_used_elem() for this purpose.

All existing users are updated accordingly.

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/libqos/virtio.c
tests/libqos/virtio.h
tests/virtio-9p-test.c
tests/virtio-blk-test.c
tests/virtio-net-test.c
tests/virtio-scsi-test.c