[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: |
Eric Auger |
|
Subject: |
Re: [PATCH] vfio/pci: Remove vfio_detach_device from vfio_realize error path |
|
Date: |
Thu, 12 Oct 2023 08:37:20 +0200 |
|
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
Hi Zhenzhong,
On 10/12/23 04:34, Duan, Zhenzhong wrote:
>
>> -----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!
Eric
>
> Thanks
> Zhenzhong
>