qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Possible reference leak in device_set_realized(...)


From: Knut Omang
Subject: Re: [Qemu-devel] Possible reference leak in device_set_realized(...)
Date: Tue, 12 Jan 2016 11:44:41 +0100

On Fri, 2016-01-01 at 23:37 +0100, Paolo Bonzini wrote:
> 
> On 31/12/2015 19:13, Ilya Lesokhin wrote:
> > I was able to overcome this issue by calling object_unparent on my
> > device but I’m not sure that the correct way of fixing it.
> 
> Yes, it's definitely the right way to fix it.

Sorry for the late follow-up on this one, but I had to find some more
time to spend with the code (and with valgrind too) to understand
better/verify what was going on in the qdev/qom layers.

In the SR/IOV patch the object is created by pci_create.
Since there is no corresponding pci_delete, I assume this means that
the correct way to clean up from pci_create is simply a call to
object_unparent() as you indicate, and this is what is missing from the
patch set.

So the full setup/teardown sequence per VF then becomes:

pci_create(...)
<realize>

<unrealize>
object_unparent(...)


Thanks,
Knut




reply via email to

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