From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCFvD-0006wE-8g for qemu-devel@nongnu.org; Mon, 26 Mar 2012 15:49:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCFvB-0006e9-GP for qemu-devel@nongnu.org; Mon, 26 Mar 2012 15:49:42 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:62427) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCFvB-0006dw-BU for qemu-devel@nongnu.org; Mon, 26 Mar 2012 15:49:41 -0400 Received: by obbwd20 with SMTP id wd20so6405806obb.4 for ; Mon, 26 Mar 2012 12:49:39 -0700 (PDT) Message-ID: <4F70C850.5030602@codemonkey.ws> Date: Mon, 26 Mar 2012 14:49:36 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1332727608-26523-1-git-send-email-liwp@linux.vnet.ibm.com> <4F705F08.4010002@siemens.com> <4F70A877.3060809@codemonkey.ws> <4F70C3E0.4000708@web.de> <4F70C4F6.8090900@codemonkey.ws> <4F70C55D.4030203@web.de> <4F70C5FA.4060605@codemonkey.ws> <4F70C726.9020504@web.de> In-Reply-To: <4F70C726.9020504@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Gavin Shan , "qemu-devel@nongnu.org" , Isaku Yamahata , Avi Kivity , Paolo Bonzini , Wanpeng Li On 03/26/2012 02:44 PM, Jan Kiszka wrote: > On 2012-03-26 21:39, Anthony Liguori wrote: >> On 03/26/2012 02:37 PM, Jan Kiszka wrote: >>> On 2012-03-26 21:35, Anthony Liguori wrote: >>>>>> Since this is an easily refactorable thing to look at later, I think >>>>>> we should >>>>>> start with extracting the types. >>>>> >>>>> My worry is that those three refactorings set bad examples for others. >>>>> So I'd like to avoid such back and forth if possible. >>>> >>>> I'm not really worried about it. It's so easier to refactor this >>>> later. Why rush it now? >>> >>> You rush changing the current layout, not me. :) >> >> No, I'm trying to do incremental changes without boiling the ocean in >> the process. >> >> I think we all are in violent agreement about where we want to end up >> (as opaque types as possible). I don't want to hold back additional >> refactoring on doing this right (and it's not just a matter of >> malloc/free). > > Either I'm missing it in the code shuffling, or it's not part of this > series: Can you point out where more that a forward reference and > malloc/free is needed? QOM is built around the concept that the type size is know (as is GObject). type_initialize() assumes that the pointer passed is an adequate size. You would either need to move to a model where the memory was completely owned by QOM (which would mean folding type_new into type_initialize) or have a way to query instance size for a given type. This would also mean that reference counting should be revisited although with how dereferencing a parent affects the child. It's not rocket science, but it's also something that needs to be done carefully. Regards, Anthony Liguori > > Jan >