qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] virtio-mmio: update queue size on guest write
@ 2019-12-24  8:14 Denis Plotnikov
  2019-12-24 15:02 ` Stefano Garzarella
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Plotnikov @ 2019-12-24  8:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst

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

Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
---
 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 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;
-- 
2.17.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-24 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-24  8:14 [PATCH v1] virtio-mmio: update queue size on guest write Denis Plotnikov
2019-12-24 15:02 ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).