vfio/pci: Introduce a vfio pci hot reset interface
commitc328e7e8ad1c969dbcbe90ee76afcd3cfec5e945
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Tue, 21 Nov 2023 08:44:07 +0000 (21 16:44 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 19 Dec 2023 18:03:38 +0000 (19 19:03 +0100)
tree2df4da80b0563d5b591f4cfa21c8a57b9c0e2a06
parent4d36ec23a75eb387492f4d68ff1b8eeee5d68142
vfio/pci: Introduce a vfio pci hot reset interface

Legacy vfio pci and iommufd cdev have different process to hot reset
vfio device, expand current code to abstract out pci_hot_reset callback
for legacy vfio, this same interface will also be used by iommufd
cdev vfio device.

Rename vfio_pci_hot_reset to vfio_legacy_pci_hot_reset and move it
into container.c.

vfio_pci_[pre/post]_reset and vfio_pci_host_match are exported so
they could be called in legacy and iommufd pci_hot_reset callback.

Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/container.c
hw/vfio/pci.c
hw/vfio/pci.h
include/hw/vfio/vfio-container-base.h