From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCXEN-0002RU-1K for qemu-devel@nongnu.org; Tue, 27 Mar 2012 10:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCXEB-0000BD-UU for qemu-devel@nongnu.org; Tue, 27 Mar 2012 10:18:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCXEB-0000Aw-Mg for qemu-devel@nongnu.org; Tue, 27 Mar 2012 10:18:27 -0400 Message-ID: <4F71CC2B.3060705@redhat.com> Date: Tue, 27 Mar 2012 16:18:19 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1332727608-26523-1-git-send-email-liwp@linux.vnet.ibm.com> <4F705F08.4010002@siemens.com> <20120326155444.GJ6016@valinux.co.jp> <4F70A77D.3020204@codemonkey.ws> <4F71970D.7060802@redhat.com> <4F71C61A.2020900@codemonkey.ws> In-Reply-To: <4F71C61A.2020900@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 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: Anthony Liguori Cc: Anthony Liguori , Wanpeng Li , Jan Kiszka , qemu-devel@nongnu.org, Isaku Yamahata , Paolo Bonzini , Gavin Shan On 03/27/2012 03:52 PM, Anthony Liguori wrote: > On 03/27/2012 05:31 AM, Avi Kivity wrote: >>> >>> I think the better approach is to have a PCNorthBridge base-class that >>> contains functionality like PAM/SRAM that both I440FX and Q35 inherit >>> from. >> >> I hate to transform this into a languagey discussion, but I don't think >> inheritance is the right thing here. While both 440fx and q35 are north >> bridges, the similar implementation of PAM/SMRAM is not part of that. >> It's just a random result of the chips' evolution. I think the code for >> PAM/SMRAM can be reused if the specs match, but using a has-a instead of >> an is-a relationship. > > The direction I was heading with the i440fx, the i440fx has-a > i440fx-pmc and it was the pmc that actually did PAM/SMRAM. > > I don't recall there being significant i440fx specific logic in the > i440fx-pmc so it's entirely possible the the i440fx-pmc could be > renamed to PCNorthBridge and then both the i440fx and q35 could has-a > the same PCNorthBridge (possible with some properties to control > certain behaviors. > Sounds about right. > We really need to push forward with the refactoring to find the right > model here. > Yes. This is opportunistic reuse - we find some sections of both specs that are identical, and we reuse the code there. In fact code duplication is also justified here. The specs are duplicated, why not the code. Not against deduplication of course, but we need not go out of our way here. -- error compiling committee.c: too many arguments to function