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: Paolo Bonzini
Subject: Re: [Qemu-devel] Possible reference leak in device_set_realized(...)
Date: Tue, 12 Jan 2016 13:00:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0


On 12/01/2016 11:44, Knut Omang wrote:
> 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(...)

Almost: object_unparent takes care of unrealizing.

Paolo



reply via email to

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