diff mbox series

[RFT,2/4] virtio-pci: set enabled for legacy device

Message ID 20190322092806.21838-3-jasowang@redhat.com
State New
Headers show
Series Don't start virtqueues that are not enabled for vhost | expand

Commit Message

Jason Wang March 22, 2019, 9:28 a.m. UTC
We don't set enabled for legacy device, this turns out to be an issue
if we want to check it through vhost. So just simply set it when
setting pa of a virtqueue.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/virtio/virtio-pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index cb44e19b67..887ee2783c 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -306,8 +306,10 @@  static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
         if (pa == 0) {
             virtio_pci_reset(DEVICE(proxy));
         }
-        else
+        else {
             virtio_queue_set_addr(vdev, vdev->queue_sel, pa);
+            proxy->vqs[vdev->queue_sel].enabled = 1;
+        }
         break;
     case VIRTIO_PCI_QUEUE_SEL:
         if (val < VIRTIO_QUEUE_MAX)