From: "Andreas Färber" <afaerber@suse.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Liu Ping Fan <pingfank@linux.vnet.ibm.com>,
liu ping fan <qemulist@gmail.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug
Date: Mon, 27 Aug 2012 13:46:05 +0200 [thread overview]
Message-ID: <503B5DFD.2030106@suse.de> (raw)
In-Reply-To: <CAJnKYQkxtSukH3u4_c9bdixxndSVTcRngUmfTE0iLOUXSD3QnQ@mail.gmail.com>
Am 27.08.2012 09:22, schrieb liu ping fan:
> On Sun, Aug 26, 2012 at 11:51 PM, Anthony Liguori <aliguori@us.ibm.com> wrote:
>> Right now, you need to pair up object_new with object_delete. This is
>> impractical when using reference counting because we would like to ensure that
>> object_unref() also frees memory when needed.
>>
>> The first few patches fix this problem by introducing a release callback so
>> that objects that need special release behavior (i.e. g_free) can do that.
>>
>> Since link and child properties all hold references, in order to actually free
>> an object, we need to break those links. User created devices end up as
>> children of a container. But child properties cannot be removed which means
>> there's no obvious way to remove the reference and ultimately free the object.
>>
> Why? Since we call _add_child() in qdev_device_add(), why can not we
> call object_property_del_child() for qmp_device_del(). Could you
> explain it more detail?
Seconded. If we hot-unplug a device, we should surely remove its child<>
property from /machine/unassigned or parent bus or whatever.
Why is it that child<> properties cannot be removed?
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-08-27 11:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-26 15:51 [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug Anthony Liguori
2012-08-26 15:51 ` [Qemu-devel] [PATCH 1/9] savevm: don't rely on paths if we can store a DeviceState object Anthony Liguori
2012-08-26 15:51 ` [Qemu-devel] [PATCH 2/9] object: automatically free objects based on a release function Anthony Liguori
2012-08-27 13:31 ` Andreas Färber
2012-08-26 15:51 ` [Qemu-devel] [PATCH 3/9] qbus: remove glib_allocated/qom_allocated and use release hook to free memory Anthony Liguori
2012-08-27 14:02 ` Andreas Färber
2012-08-27 14:22 ` Anthony Liguori
2012-08-27 14:43 ` Andreas Färber
2012-08-26 15:51 ` [Qemu-devel] [PATCH 4/9] object: remove object_finalize Anthony Liguori
2012-08-27 15:01 ` Andreas Färber
2012-08-27 15:49 ` Anthony Liguori
2012-08-26 15:51 ` [Qemu-devel] [PATCH 5/9] object: add support for nullable child properties Anthony Liguori
2012-08-26 15:51 ` [Qemu-devel] [PATCH 6/9] qdev: make devices created with device_add nullable so they can be deleted Anthony Liguori
2012-08-26 15:51 ` [Qemu-devel] [PATCH 7/9] qdev: add notifier for when the device loses its parent bus (eject) Anthony Liguori
2012-08-26 15:51 ` [Qemu-devel] [PATCH 8/9] qdev: make qdev_set_parent_bus() just set a link property Anthony Liguori
2012-08-27 7:22 ` liu ping fan
2012-08-27 13:12 ` Anthony Liguori
2012-08-26 15:51 ` [Qemu-devel] [PATCH 9/9] hotplug: refactor hotplug to leverage new QOM functions Anthony Liguori
2012-08-27 7:22 ` liu ping fan
2012-08-27 7:22 ` [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug liu ping fan
2012-08-27 11:46 ` Andreas Färber [this message]
2012-08-27 12:09 ` Paolo Bonzini
2012-08-27 13:15 ` Anthony Liguori
2012-10-09 17:15 ` Vasilis Liaskovitis
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=503B5DFD.2030106@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=pbonzini@redhat.com \
--cc=pingfank@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemulist@gmail.com \
/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).