qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH] vfio/pci: Remove vfio_detach_device from vfio_realize error


From: Duan, Zhenzhong
Subject: RE: [PATCH] vfio/pci: Remove vfio_detach_device from vfio_realize error path
Date: Thu, 12 Oct 2023 02:34:08 +0000


>-----Original Message-----
>From: Eric Auger <eric.auger@redhat.com>
>Sent: Thursday, October 12, 2023 4:10 AM
>To: eric.auger.pro@gmail.com; eric.auger@redhat.com; qemu-
>devel@nongnu.org; alex.williamson@redhat.com; clg@redhat.com; Duan,
>Zhenzhong <zhenzhong.duan@intel.com>; Liu, Yi L <yi.l.liu@intel.com>;
>yanghliu@redhat.com
>Subject: [PATCH] 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>

Thanks
Zhenzhong



reply via email to

[Prev in Thread] Current Thread [Next in Thread]