aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Plotnikov <dplotnikov@virtuozzo.com>2019-12-24 11:14:46 +0300
committerMichael Roth <mdroth@linux.vnet.ibm.com>2020-05-11 18:09:43 -0500
commit0253531824d1a0ef39cba3da3bdb1bb161834fd4 (patch)
tree01f68c44cd7d6620ed80519a9e92a2ebc8f75662
parent2f4affb7213ab0003bc2fa8f0d467399059106de (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> (cherry picked from commit 1049f4c62c4070618cc5defc9963c6a17ae7a5ae) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-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 94d934c44b..1e40a74869 100644
--- a/hw/virtio/virtio-mmio.c
+++ b/hw/virtio/virtio-mmio.c
@@ -295,8 +295,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;