when do virtual secondary bus reset, the vfio device under this bus need to do host bus reset to reset the device. so add this case.
Signed-off-by: Chen Fan <chen.fan.f...@cn.fujitsu.com> --- hw/vfio/pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 94ff4e1..29a2b12 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -4028,6 +4028,14 @@ static void vfio_pci_reset(DeviceState *dev) trace_vfio_pci_reset(vdev->vbasedev.name); + if (vdev->needs_bus_reset) { + vdev->needs_bus_reset = false; + if (vdev->vbasedev.needs_reset) { + vfio_pci_hot_reset(vdev, false); + } + return; + } + vfio_pci_pre_reset(vdev); if (vdev->resetfn && !vdev->resetfn(vdev)) { -- 1.9.3