qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Wanpeng Li <liwp@linux.vnet.ibm.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	qemu-devel@nongnu.org, Isaku Yamahata <yamahata@valinux.co.jp>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM
Date: Tue, 27 Mar 2012 08:52:26 -0500	[thread overview]
Message-ID: <4F71C61A.2020900@codemonkey.ws> (raw)
In-Reply-To: <4F71970D.7060802@redhat.com>

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.

We really need to push forward with the refactoring to find the right model here.

Regards,

Anthony Liguori

>
> As a counterexample, consider a northbridge that implements PAM/SMRAM
> differently.  You'd have to refactor PCNorthBridge into two separate
> classes.  With the other approach the new northbridge simply doesn't
> include the existing PAM/SMRAM implementation and instead implements its
> own.
>

  reply	other threads:[~2012-03-27 13:52 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26  2:06 [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 1/6] eliminate piix_pci.c and module i440fx and piix3 Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 2/6] convert MemoryRegion to QOM Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 3/6] convert pci-host " Wanpeng Li
2012-03-26  7:32   ` Stefan Hajnoczi
2012-03-26  9:22   ` Wanpeng Li
2012-03-26 14:25   ` Andreas Färber
2012-03-26  2:06 ` [Qemu-devel] [PATCH 4/6] prepare to create HPET, RTC and i8254 through composition Wanpeng Li
2012-03-26  2:06 ` [Qemu-devel] [PATCH 5/6] merge pc_piix.c to pc.c Wanpeng Li
2012-03-26 12:42   ` Avi Kivity
2012-03-26 12:47     ` Jan Kiszka
2012-03-26 17:37       ` Anthony Liguori
2012-03-26  2:06 ` [Qemu-devel] [PATCH 6/6] make some functions static Wanpeng Li
2012-03-26 12:20 ` [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM Jan Kiszka
2012-03-26 15:54   ` Isaku Yamahata
2012-03-26 17:29     ` Anthony Liguori
2012-03-27 10:31       ` Avi Kivity
2012-03-27 13:52         ` Anthony Liguori [this message]
2012-03-27 14:18           ` Avi Kivity
2012-03-26 17:17   ` Blue Swirl
2012-03-26 17:33   ` Anthony Liguori
2012-03-26 19:30     ` Jan Kiszka
2012-03-26 19:35       ` Anthony Liguori
2012-03-26 19:37         ` Jan Kiszka
2012-03-26 19:39           ` Anthony Liguori
2012-03-26 19:44             ` Jan Kiszka
2012-03-26 19:49               ` Anthony Liguori
2012-03-26 20:10                 ` Jan Kiszka
2012-03-26 20:13                   ` Anthony Liguori
2012-03-26 20:30                     ` Jan Kiszka
2012-03-26 21:00                       ` Anthony Liguori
2012-03-26 19:52               ` Anthony Liguori
2012-03-26 12:47 ` Andreas Färber
2012-03-26 12:57   ` Wanpeng Li
2012-03-26 17:09 ` Blue Swirl
2012-03-26 17:35   ` Anthony Liguori
2012-03-26 17:43     ` Blue Swirl
2012-03-26 17:45       ` Anthony Liguori
2012-03-26 18:01         ` Blue Swirl
2012-03-26 18:07           ` Anthony Liguori
2012-03-26 18:25             ` Blue Swirl
2012-03-26 17:25 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F71C61A.2020900@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=liwp@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shangw@linux.vnet.ibm.com \
    --cc=yamahata@valinux.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).