diff mbox series

[RFC,v2,3/5] virtio-pci: use virtio_force_modern()

Message ID 20211112145749.618157-4-pasic@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series virtio: early detect 'modern' virtio | expand

Commit Message

Halil Pasic Nov. 12, 2021, 2:57 p.m. UTC
Let us detect usage via the modern interface by tapping into the place
that implements the 'modern' reset.

Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
---
 hw/virtio/virtio-pci.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 6e16e2705c..8dd862da21 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1297,6 +1297,7 @@  static void virtio_pci_common_write(void *opaque, hwaddr addr,
 
         if (vdev->status == 0) {
             virtio_pci_reset(DEVICE(proxy));
+            virtio_force_modern(virtio_bus_get_device(&proxy->bus));
         }
 
         break;