From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rht1C-0001p8-67 for qemu-devel@nongnu.org; Mon, 02 Jan 2012 20:18:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rht1B-00030P-4s for qemu-devel@nongnu.org; Mon, 02 Jan 2012 20:18:22 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:34147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rht1A-00030K-Pj for qemu-devel@nongnu.org; Mon, 02 Jan 2012 20:18:21 -0500 Received: by iagj37 with SMTP id j37so34884793iag.4 for ; Mon, 02 Jan 2012 17:18:20 -0800 (PST) Message-ID: <4F025757.2060106@codemonkey.ws> Date: Mon, 02 Jan 2012 19:18:15 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1324399916-21315-1-git-send-email-aliguori@us.ibm.com> <1324399916-21315-2-git-send-email-aliguori@us.ibm.com> <4F01F075.2070706@redhat.com> In-Reply-To: <4F01F075.2070706@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Anthony Liguori , qemu-devel@nongnu.org, Markus Armbruster On 01/02/2012 11:59 AM, Paolo Bonzini wrote: > On 12/20/2011 05:51 PM, Anthony Liguori wrote: >> hw/object.c | 469 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> hw/object.h | 427 +++++++++++++++++++++++++++++++++++++++++++++++++++ > > A couple more remarks: > > 1) Please put it outside hw/ Done :-) > > 2) Why do you need a list for the interface objects at all? You can make > obj->interfaces point to a single blob, and initialize the objects in place. You > only need to store the number of interfaces into the TypeImpl or in the object > header, or add a dummy Interface at the end whose contents are all-zero. Interfaces aren't really handled in a special way. You could easily make it so that the infrastructure could be modified to allow true multiple inheritance. I'm not sure I see an obvious benefit to making interfaces handled more as a special case. Right now, the only place that really even knows about interfaces is dynamic_cast and initialization. That seems like a good thing to me. Regards, Anthony Liguori > Paolo >