qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Jason Wang
Subject: [Qemu-devel] [RFT 2/4] virtio-pci: set enabled for legacy device
Date: Fri, 22 Mar 2019 17:28:04 +0800

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 <address@hidden>
---
 hw/virtio/virtio-pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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)
-- 
2.19.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]