qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Paul Brook" <paul@codesourcery.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Anthony Liguori" <anthony@codemonkey.ws>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] ARM QOM conversion / class hierarchy
Date: Tue, 20 Mar 2012 14:04:11 -0500	[thread overview]
Message-ID: <20120320190411.GC29058@illuin> (raw)
In-Reply-To: <CAFEAcA_TsUS5p4BH_gUvhbW8Q6frxSgcMDOP=T9b7O0nDa8AHg@mail.gmail.com>

On Tue, Mar 20, 2012 at 04:32:31PM +0000, Peter Maydell wrote:
> On 20 March 2012 16:31, Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> > Rather than key off an ID you could also just break
> > implementation-specific functionality out into a set of interfaces you
> > implement/override as part of the objects' initialization. Same ends, and
> > still fits the model pretty nicely, assuming the functionality is all
> > derivable from the common base-class.
> 
> I'm not sure what you have in mind here -- could you explain
> in a little more detail, please?

Essentially what Paul suggested, minimal subclassing to encapsulate the
major architectural characteristics of a cpu, but also making use of the fact
that we *do* have multiple inheritance for QOM interfaces to do finer-grained
modeling of specific features. SIMD/NEON/DSP, for instance, could be proper
QOM interfaces that models from multiple families/architectures implement.

Ultimately, as Paul said, it just boils down to implicit subclasses in place of
enumerating features for use by common routines. So..it doesn't buy you
much really, except maybe maintaining devices out of tree. But it's a way to
do what you were suggesting with option #2 while avoiding not being "OO-like",
since it's a more formal way to modify a class' behavior. But maybe that's
a non-issue to begin with.

> 
> thanks
> -- PMM
> 

  reply	other threads:[~2012-03-20 19:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 12:12 [Qemu-devel] ARM QOM conversion / class hierarchy Peter Maydell
2012-03-20 14:08 ` Paul Brook
2012-03-20 14:59   ` Peter Maydell
2012-03-20 16:06     ` Paul Brook
2012-03-20 16:20       ` Peter Maydell
2012-03-20 17:14         ` Paul Brook
2012-03-20 17:19           ` Peter Maydell
2012-03-20 16:56   ` Anthony Liguori
2012-03-20 17:14     ` Paul Brook
2012-03-20 17:20       ` Andreas Färber
2012-03-20 16:31 ` Michael Roth
2012-03-20 16:32   ` Peter Maydell
2012-03-20 19:04     ` Michael Roth [this message]
2012-03-20 17:01   ` Paul Brook

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=20120320190411.GC29058@illuin \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=paul@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).