From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbYC4-0007zi-R9 for qemu-devel@nongnu.org; Fri, 16 Dec 2011 08:51:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbYC3-0001Eo-Mn for qemu-devel@nongnu.org; Fri, 16 Dec 2011 08:51:24 -0500 Received: from e4.ny.us.ibm.com ([32.97.182.144]:50937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbYC3-0001Ej-Ik for qemu-devel@nongnu.org; Fri, 16 Dec 2011 08:51:23 -0500 Received: from /spool/local by e4.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Dec 2011 08:51:21 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBGDpH983457162 for ; Fri, 16 Dec 2011 08:51:17 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBGDpF2v026608 for ; Fri, 16 Dec 2011 08:51:16 -0500 Message-ID: <4EEB4CD1.7050701@us.ibm.com> Date: Fri, 16 Dec 2011 07:51:13 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1323721784-704-1-git-send-email-aliguori@us.ibm.com> <4EEA3813.80006@us.ibm.com> <4EEB1277.4070803@redhat.com> <4EEB1ABB.50204@redhat.com> <4EEB1F3B.8070302@redhat.com> <4EEB3891.2020003@redhat.com> In-Reply-To: <4EEB3891.2020003@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Peter Maydell , Stefan Hajnoczi , Jan Kiszka , qemu-devel@nongnu.org, Luiz Capitulino , Markus Armbruster On 12/16/2011 06:24 AM, Paolo Bonzini wrote: > On 12/16/2011 11:36 AM, Kevin Wolf wrote: >> > I think actually this is not the biggest problem. child properties are >> > dynamic, and it's not a problem IMO if they are created like that. >> >> That they are added in an init function is an indicator that they aren't >> really dynamic. > > That's true. However, another indicator is that anything that does not have a > struct field is also not really static. :) > > So right now, child properties are all "dynamic" in this sense. This could > change when Anthony converts buses to QOM. The bus right now is embedded into > the HBA's struct, is not a pointer. This likely would change when buses are > QOM-ized, but then the bus would indeed be a 100% static child. > >> I think having a child property that can be NULL could be >> reasonable. > > I think Anthony convinced me this is not the case (unlike links). Even if buses > and similar objects are changed to pointers because the implementation needs > that, those pointers should never be NULL (or if they can, the child property > should not exist when they are NULL). What I would like to get to eventually is: struct ISASerial { Device parent; UART _child uart; ISABus _link *bus; }; A child should be able to be part of the parent devices memory with its life cycle bound to the parents life cycle. This is why a child property shouldn't be nullable. Regards, Anthony Liguori > > Paolo >