[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About the instance_finalize callback in VFIO PCI
From: |
Yang Zhong |
Subject: |
Re: About the instance_finalize callback in VFIO PCI |
Date: |
Wed, 22 Mar 2023 08:39:27 -0400 |
On Tue, Mar 21, 2023 at 09:44:18PM +0100, Paolo Bonzini wrote:
> Il mar 21 mar 2023, 18:30 Cédric Le Goater <clg@kaod.org> ha scritto:
>
> > I would have thought that user_creatable_cleanup would have taken care
> > of it. But it's not. This needs some digging.
> >
>
> user_creatable_cleanup is only for -object, not for -device.
>
Paolo, thanks for helping to clarify this issue.
Maybe i am clear now, the vfio_instance_finalize() in the
hw/vfio/pci.c is only for unhotplug vfio pci device from monitor to
cleanup resource. For static "-device vfio-pci ....." command, the
cleanup resource is responsibility of kernel exit system, not the qemu
vfio. Once we close Qemu process, the kernel will call do_exit() to
release these resource, so the vfio module in kernel will handle
these cleanup work. thanks!
Yang
> Paolo
>
>
> > C.
> >
> >
> > > By the way, i also debugged other instance_finalize callback functions,
> > > if my understanding is right, all instance_finalize callback should be
> > > called from object_unref(object) from qemu_cleanup(void) in
> > > ./softmmu/runstate.c. But there is no VFIO related object_unref() call in
> > > this cleanup function, So the instance_finalize callback in vfio pci
> > > should be useless? thanks!
> > >
> > > Regards,
> > > Yang
> > >
> > >
> >
> >