From: Eric Auger <eric.auger@redhat.com>
To: "Duan, Zhenzhong" <zhenzhong.duan@intel.com>,
"eric.auger.pro@gmail.com" <eric.auger.pro@gmail.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
"clg@redhat.com" <clg@redhat.com>,
"Liu, Yi L" <yi.l.liu@intel.com>,
"yanghliu@redhat.com" <yanghliu@redhat.com>
Subject: Re: [PATCH] vfio/pci: Remove vfio_detach_device from vfio_realize error path
Date: Thu, 12 Oct 2023 08:37:20 +0200 [thread overview]
Message-ID: <8323dbfa-98ed-1db3-d901-a1f859c46685@redhat.com> (raw)
In-Reply-To: <PH7PR11MB6722D7A0E5D47F6E9A5B191C92D3A@PH7PR11MB6722.namprd11.prod.outlook.com>
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
>
next prev parent reply other threads:[~2023-10-12 6:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 20:09 [PATCH] vfio/pci: Remove vfio_detach_device from vfio_realize error path Eric Auger
2023-10-12 2:34 ` Duan, Zhenzhong
2023-10-12 6:37 ` Eric Auger [this message]
2023-10-12 6:48 ` Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8323dbfa-98ed-1db3-d901-a1f859c46685@redhat.com \
--to=eric.auger@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=eric.auger.pro@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=yanghliu@redhat.com \
--cc=yi.l.liu@intel.com \
--cc=zhenzhong.duan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).