[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL v3 28/32] virtio-mmio: update queue size on guest write

From: Michael S. Tsirkin
Subject: [PULL v3 28/32] virtio-mmio: update queue size on guest write
Date: Tue, 7 Jan 2020 11:31:37 -0500

From: Denis Plotnikov <address@hidden>

Some guests read back queue size after writing it.
Always update the on size write otherwise they might be confused.

Cc: address@hidden
Signed-off-by: Denis Plotnikov <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
 hw/virtio/virtio-mmio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c
index ef40b7a9b2..872f2cd237 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -308,8 +308,9 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, 
uint64_t value,
         trace_virtio_mmio_queue_write(value, VIRTQUEUE_MAX_SIZE);
+        virtio_queue_set_num(vdev, vdev->queue_sel, value);
         if (proxy->legacy) {
-            virtio_queue_set_num(vdev, vdev->queue_sel, value);
             virtio_queue_update_rings(vdev, vdev->queue_sel);
         } else {
             proxy->vqs[vdev->queue_sel].num = value;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]