qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to ta


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM
Date: Tue, 27 Mar 2012 12:31:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0

On 03/26/2012 07:29 PM, Anthony Liguori wrote:
> On 03/26/2012 10:54 AM, Isaku Yamahata wrote:
>> On Mon, Mar 26, 2012 at 02:20:24PM +0200, Jan Kiszka wrote:
>>> I'm also sure we will have to refactor the merge significantly again
>>> for
>>> the introduction of additional chipsets and PC boards. But unless those
>>> requirements can already be specified (Isaku?), that might be
>>> unavoidable.
>>
>> Agreed. At least I'd like pam/smram stuff decoupled from piix.
>
> s/piix/i440fx/
>
> PAM/SRAM has nothing do to with the piix.  Part of the problem with
> the current layout is that the distinction between i440fx and piix is
> not clear.  The piix is just a SuperIO chip (and southbridge).

Right.

>
> 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.

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.

-- 
error compiling committee.c: too many arguments to function




reply via email to

[Prev in Thread] Current Thread [Next in Thread]