From be3a6781605803b2c48a48135002869ed2c73cf1 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Thu, 1 Feb 2018 21:21:28 +0100 Subject: 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 Reviewed-by: Stefan Hajnoczi --- tests/virtio-scsi-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/virtio-scsi-test.c') diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c index 2934305b2b..bcf408fbb6 100644 --- a/tests/virtio-scsi-test.c +++ b/tests/virtio-scsi-test.c @@ -121,7 +121,8 @@ static uint8_t virtio_scsi_do_command(QVirtIOSCSI *vs, const uint8_t *cdb, } qvirtqueue_kick(vs->dev, vq, free_head); - qvirtio_wait_used_elem(vs->dev, vq, free_head, QVIRTIO_SCSI_TIMEOUT_US); + qvirtio_wait_used_elem(vs->dev, vq, free_head, NULL, + QVIRTIO_SCSI_TIMEOUT_US); response = readb(resp_addr + offsetof(struct virtio_scsi_cmd_resp, response)); -- cgit v1.2.1