qemu/hw/vfio
Eric Auger c0f527f4cc vfio/pci: Remove vfio_detach_device from vfio_realize error path
In vfio_realize, on the error path, we currently call
vfio_detach_device() after a successful vfio_attach_device.
While this looks natural, vfio_instance_finalize also induces
a vfio_detach_device(), and it seems to be the right place
instead as other resources are released there which happen
to be a prerequisite to a successful UNSET_CONTAINER.

So let's rely on the finalize vfio_detach_device call to free
all the relevant resources.

Fixes: a28e06621170 ("vfio/pci: Introduce vfio_[attach/detach]_device")
Reported-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2023-10-18 10:10:49 +02:00
..
amd-xgbe.c
ap.c vfio/ap: Remove pointless apdev variable 2023-10-18 10:10:49 +02:00
calxeda-xgmac.c
ccw.c vfio/ccw: Use vfio_[attach/detach]_device 2023-10-18 10:10:49 +02:00
common.c vfio/pci: Fix a potential memory leak in vfio_listener_region_add 2023-10-18 10:10:49 +02:00
container.c vfio/common: Move legacy VFIO backend code into separate container.c 2023-10-18 10:10:49 +02:00
display.c vfio/display: Fix missing update to set backing fields 2023-10-05 22:04:51 +02:00
helpers.c vfio/common: Move IOMMU agnostic helpers to a separate file 2023-10-18 10:10:49 +02:00
igd.c *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
Kconfig
meson.build vfio/common: Move legacy VFIO backend code into separate container.c 2023-10-18 10:10:49 +02:00
migration.c vfio/migration: Block VFIO migration with background snapshot 2023-09-11 08:34:06 +02:00
pci-quirks.c spapr: Remove support for NVIDIA V100 GPU with NVLink2 2023-09-18 07:25:28 -03:00
pci.c vfio/pci: Remove vfio_detach_device from vfio_realize error path 2023-10-18 10:10:49 +02:00
pci.h vfio/pci: detect the support of dynamic MSI-X allocation 2023-10-05 22:04:51 +02:00
platform.c vfio/platform: Use vfio_[attach/detach]_device 2023-10-18 10:10:49 +02:00
spapr.c Replace qemu_real_host_page variables with inlined functions 2022-04-06 10:50:38 +02:00
trace-events vfio/platform: Use vfio_[attach/detach]_device 2023-10-18 10:10:49 +02:00
trace.h