From: Paolo Bonzini <pbonzini@redhat.com>
To: Knut Omang <knut.omang@oracle.com>,
Ilya Lesokhin <ilyal@mellanox.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Haggai Eran <haggaie@mellanox.com>
Subject: Re: [Qemu-devel] Possible reference leak in device_set_realized(...)
Date: Tue, 12 Jan 2016 13:00:11 +0100 [thread overview]
Message-ID: <5694EACB.8040009@redhat.com> (raw)
In-Reply-To: <1452595481.13986.144.camel@oracle.com>
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
prev parent reply other threads:[~2016-01-12 12:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-31 18:13 [Qemu-devel] Possible reference leak in device_set_realized(...) Ilya Lesokhin
2016-01-01 22:37 ` Paolo Bonzini
2016-01-12 10:44 ` Knut Omang
2016-01-12 12:00 ` Paolo Bonzini [this message]
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=5694EACB.8040009@redhat.com \
--to=pbonzini@redhat.com \
--cc=haggaie@mellanox.com \
--cc=ilyal@mellanox.com \
--cc=knut.omang@oracle.com \
--cc=qemu-devel@nongnu.org \
/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).