aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio-mmio.c
diff options
context:
space:
mode:
authorDenis Plotnikov <dplotnikov@virtuozzo.com>2019-12-24 11:14:46 +0300
committerMichael S. Tsirkin <mst@redhat.com>2020-01-06 12:04:51 -0500
commit1049f4c62c4070618cc5defc9963c6a17ae7a5ae (patch)
tree1dc60ed2cff8dcbc4a009a53f5ef0415fb33b26c /hw/virtio/virtio-mmio.c
parentcec0242ab49d179c811d58b8c9c13d4e22e0e9c8 (diff)
virtio-mmio: update queue size on guest write
Some guests read back queue size after writing it. Always update the on size write otherwise they might be confused. Cc: qemu-stable@nongnu.org Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com> Message-Id: <20191224081446.17003-1-dplotnikov@virtuozzo.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/virtio-mmio.c')
-rw-r--r--hw/virtio/virtio-mmio.c3
1 files changed, 2 insertions, 1 deletions
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,
break;
case VIRTIO_MMIO_QUEUE_NUM:
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;