From 66e411885a23c96ff73742d06b793fec3ceaebb7 Mon Sep 17 00:00:00 2001 From: Zheyu Ma Date: Wed, 20 Mar 2024 10:04:42 +0100 Subject: [PATCH] libqos/virtio.c: Correct 'flags' reading in qvirtqueue_kick MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In qvirtqueue_kick(), the 'flags' were previously being incorrectly read from vq->avail instead of the correct vq->used location. This update ensures 'flags' are read from the correct location as per the virtio standard. Signed-off-by: Zheyu Ma Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Message-ID: <20240320090442.267525-1-zheyuma97@gmail.com> Signed-off-by: Thomas Huth --- tests/qtest/libqos/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c index 82a6e122bf..a21b6eee9c 100644 --- a/tests/qtest/libqos/virtio.c +++ b/tests/qtest/libqos/virtio.c @@ -394,7 +394,7 @@ void qvirtqueue_kick(QTestState *qts, QVirtioDevice *d, QVirtQueue *vq, qvirtio_writew(d, qts, vq->avail + 2, idx + 1); /* Must read after idx is updated */ - flags = qvirtio_readw(d, qts, vq->avail); + flags = qvirtio_readw(d, qts, vq->used); avail_event = qvirtio_readw(d, qts, vq->used + 4 + sizeof(struct vring_used_elem) * vq->size);