提交 75fd6f13 编写于 作者: G Gerd Hoffmann 提交者: Michael S. Tsirkin

virtio-pci: call pci reset variant when guest requests reset.

Actually fixes linux not finding virtio 1.0 device virtqueues after
reboot.  Which is new I think, any chance linux kernel virtio code
became more strict in 4.3?
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: NFam Zheng <famz@redhat.com>
Tested-by: NFam Zheng <famz@redhat.com>
上级 79248c22
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
static void virtio_pci_bus_new(VirtioBusState *bus, size_t bus_size, static void virtio_pci_bus_new(VirtioBusState *bus, size_t bus_size,
VirtIOPCIProxy *dev); VirtIOPCIProxy *dev);
static void virtio_pci_reset(DeviceState *qdev);
/* virtio device */ /* virtio device */
/* DeviceState to VirtIOPCIProxy. For use off data-path. TODO: use QOM. */ /* DeviceState to VirtIOPCIProxy. For use off data-path. TODO: use QOM. */
...@@ -404,9 +405,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) ...@@ -404,9 +405,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
case VIRTIO_PCI_QUEUE_PFN: case VIRTIO_PCI_QUEUE_PFN:
pa = (hwaddr)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT; pa = (hwaddr)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT;
if (pa == 0) { if (pa == 0) {
virtio_pci_stop_ioeventfd(proxy); virtio_pci_reset(DEVICE(proxy));
virtio_reset(vdev);
msix_unuse_all_vectors(&proxy->pci_dev);
} }
else else
virtio_queue_set_addr(vdev, vdev->queue_sel, pa); virtio_queue_set_addr(vdev, vdev->queue_sel, pa);
...@@ -432,8 +431,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) ...@@ -432,8 +431,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
} }
if (vdev->status == 0) { if (vdev->status == 0) {
virtio_reset(vdev); virtio_pci_reset(DEVICE(proxy));
msix_unuse_all_vectors(&proxy->pci_dev);
} }
/* Linux before 2.6.34 drives the device without enabling /* Linux before 2.6.34 drives the device without enabling
...@@ -1353,8 +1351,7 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr, ...@@ -1353,8 +1351,7 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr,
} }
if (vdev->status == 0) { if (vdev->status == 0) {
virtio_reset(vdev); virtio_pci_reset(DEVICE(proxy));
msix_unuse_all_vectors(&proxy->pci_dev);
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册