From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5xlp-0004vY-39 for qemu-devel@nongnu.org; Mon, 27 Aug 2012 07:46:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5xlj-0001Nj-CX for qemu-devel@nongnu.org; Mon, 27 Aug 2012 07:46:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:51735 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5xlj-0001NN-4S for qemu-devel@nongnu.org; Mon, 27 Aug 2012 07:46:11 -0400 Message-ID: <503B5DFD.2030106@suse.de> Date: Mon, 27 Aug 2012 13:46:05 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1345996298-4892-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , Liu Ping Fan , liu ping fan , qemu-devel@nongnu.org Am 27.08.2012 09:22, schrieb liu ping fan: > On Sun, Aug 26, 2012 at 11:51 PM, Anthony Liguori = 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 ens= ure that >> object_unref() also frees memory when needed. >> >> The first few patches fix this problem by introducing a release callba= ck so >> that objects that need special release behavior (i.e. g_free) can do t= hat. >> >> Since link and child properties all hold references, in order to actua= lly 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg