From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5y8k-0008Ob-3p for qemu-devel@nongnu.org; Mon, 27 Aug 2012 08:10:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5y8e-0000XF-BY for qemu-devel@nongnu.org; Mon, 27 Aug 2012 08:09:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5y8d-0000UQ-SD for qemu-devel@nongnu.org; Mon, 27 Aug 2012 08:09:52 -0400 Message-ID: <503B637A.7060905@redhat.com> Date: Mon, 27 Aug 2012 14:09:30 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1345996298-4892-1-git-send-email-aliguori@us.ibm.com> <503B5DFD.2030106@suse.de> In-Reply-To: <503B5DFD.2030106@suse.de> 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: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: Liu Ping Fan , liu ping fan , Anthony Liguori , qemu-devel@nongnu.org Il 27/08/2012 13:46, Andreas F=E4rber ha scritto: >>> >> >>> >> Since link and child properties all hold references, in order to a= ctually 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 w= hich 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. Sure, as soon as the device is ejected by the guest. But until that point we need to keep the device in the QOM tree so that: 1) it has a canonical path; 2) it can be examined; 3) it keeps children alive. > Why is it that child<> properties cannot be removed? Yeah, I didn't quite understand the difference between unparenting and setting the child property to NULL. Paolo