When vfio device is reset(encounter FLR, or bus reset), if need to do
bus reset(vfio_pci_hot_reset_one is called), vfio_pci_pre_reset &
vfio_pci_post_reset will be called twice.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
trace_vfio_pci_hot_reset(vdev->vbasedev.name, single ? "one" : "multi");
- vfio_pci_pre_reset(vdev);
+ if (!single) {
+ vfio_pci_pre_reset(vdev);
+ }
vdev->vbasedev.needs_reset = false;
info = g_malloc0(sizeof(*info));
}
}
out_single:
- vfio_pci_post_reset(vdev);
+ if (!single) {
+ vfio_pci_post_reset(vdev);
+ }
g_free(info);
return ret;