> On Feb 21, 2022, at 10:57 AM, Stefan Hajnoczi <stefa...@redhat.com> wrote: > > On Thu, Feb 17, 2022 at 02:48:56AM -0500, Jagannathan Raman wrote: >> @@ -221,6 +272,14 @@ static void vfu_object_finalize(Object *obj) >> >> o->device = NULL; >> >> + if (o->unplug_blocker && o->pci_dev) { >> + qdev_del_unplug_blocker(DEVICE(o->pci_dev), o->unplug_blocker); >> + error_free(o->unplug_blocker); >> + o->unplug_blocker = NULL; >> + } >> + >> + o->pci_dev = NULL; > > Since we don't hold a reference to o->pci_dev there is an assumption > about the order of --object vs --device ->finalize() here. I think it > will work because softmmu/runstate.c:qemu_cleanup() doesn't unref > main_system_bus and only --object ->finalize() is called, but this seems > fragile. We should probably hold a reference to pci_dev and call > object_unref() on it. OK, will do. Thank you! -- Jag
- Re: [PATCH v6 01/19] configure... Jag Raman
- Re: [PATCH v6 01/19] configure... Paolo Bonzini
- Re: [PATCH v6 01/19] configure... Jag Raman
- Re: [PATCH v6 01/19] configure... Paolo Bonzini
- [PATCH v6 04/19] remote/machine: add HotplugHandler for ... Jagannathan Raman
- Re: [PATCH v6 04/19] remote/machine: add HotplugHan... Stefan Hajnoczi
- [PATCH v6 11/19] vfio-user: handle PCI config space acce... Jagannathan Raman
- Re: [PATCH v6 11/19] vfio-user: handle PCI config s... Stefan Hajnoczi
- [PATCH v6 09/19] vfio-user: find and init PCI device Jagannathan Raman
- Re: [PATCH v6 09/19] vfio-user: find and init PCI d... Stefan Hajnoczi
- Re: [PATCH v6 09/19] vfio-user: find and init P... Jag Raman
- [PATCH v6 05/19] remote/machine: add vfio-user property Jagannathan Raman
- Re: [PATCH v6 05/19] remote/machine: add vfio-user ... Stefan Hajnoczi
- [PATCH v6 15/19] vfio-user: handle device interrupts Jagannathan Raman
- [PATCH v6 03/19] qdev: unplug blocker for devices Jagannathan Raman
- Re: [PATCH v6 03/19] qdev: unplug blocker for devic... Stefan Hajnoczi
- Re: [PATCH v6 03/19] qdev: unplug blocker for devic... Stefan Hajnoczi
- [PATCH v6 02/19] tests/avocado: Specify target VM argume... Jagannathan Raman
- [PATCH v6 10/19] vfio-user: run vfio-user context Jagannathan Raman