From: Michael S. Tsirkin Date: Fri, 13 Dec 2019 14:22:48 +0000 (-0500) Subject: virtio: update queue size on guest write X-Git-Tag: v4.2.1~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f4affb7213ab0003bc2fa8f0d467399059106de;p=thirdparty%2Fqemu.git virtio: update queue size on guest write Some guests read back queue size after writing it. Update the size immediatly upon write otherwise they get confused. In particular this is the case for seabios. Reported-by: Roman Kagan Suggested-by: Denis Plotnikov Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin (cherry picked from commit d0c5f643383b9e84316f148affff368ac33d75b9) Signed-off-by: Michael Roth --- diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c6b47a9c738..e5c759e19eb 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1256,6 +1256,8 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr, break; case VIRTIO_PCI_COMMON_Q_SIZE: proxy->vqs[vdev->queue_sel].num = val; + virtio_queue_set_num(vdev, vdev->queue_sel, + proxy->vqs[vdev->queue_sel].num); break; case VIRTIO_PCI_COMMON_Q_MSIX: msix_vector_unuse(&proxy->pci_dev,