qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-ppc@nongnu.org, Alexander Graf <agraf@suse.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] kvm/openpic: in-kernel mpic support
Date: Thu, 13 Jun 2013 12:32:30 -0500	[thread overview]
Message-ID: <1371144750.2028.14@snotra> (raw)
In-Reply-To: <51B9A69D.4070808@suse.de> (from afaerber@suse.de on Thu Jun 13 06:01:49 2013)

On 06/13/2013 06:01:49 AM, Andreas Färber wrote:
> Am 12.06.2013 22:32, schrieb Scott Wood:
> > +typedef struct KVMOpenPICState {
> > +    SysBusDevice busdev;
> 
> SysBusDevice parent_obj; please!
> 
> http://wiki.qemu.org/QOMConventions

The word "QOMConventions" doesn't exist once in the QEMU source tree.   
How is one supposed to know that this documentation exists? :-P

Plus, this is just copied from the non-KVM MPIC file, and I see many  
other instances throughout the source tree.

> > +static int kvm_openpic_init(SysBusDevice *dev)
> 
> Please make this instance_init + realize functions - "dev" should  
> rather
> be reserved for DeviceState.

Could you elaborate?  I'm really not familiar with this stuff, and have  
not found much documentation.  Again, this is patterned after the  
existing
non-KVM openpic file.

> > +{
> > +    KVMState *s = kvm_state;
> > +    KVMOpenPICState *opp = FROM_SYSBUS(typeof(*opp), dev);
> 
> NACK, please introduce your own KVM_OPENPIC(obj) cast macro instead  
> for
> new devices - has been a topic for several weeks and months now.

There's way too much traffic on the list for me to know about something  
just because it's "been a topic".  Lately it's been too much for me to  
even scan the subject lines looking for things that look important,  
given that QEMU is only a fraction of what I spend my time on.

If you'd like to update hw/intc/openpic.c to comply with the style of  
the day, then this could be updated to match...

Also note that this is hardly the first time this patch has been posted  
(v1 was a few weeks ago, and there were RFC patches well before that).   
The first version may have even preceded this "topic".  This seems a  
bit late in the process for a bunch of style churn, when existing code  
hasn't been updated.

> > +    int kvm_openpic_model;
> > +    struct kvm_create_device cd = {0};
> > +    int ret, i;
> > +
> > +    if (!kvm_check_extension(s, KVM_CAP_DEVICE_CTRL)) {
> > +        return -EINVAL;
> > +    }
> > +
> > +    switch (opp->model) {
> > +    case OPENPIC_MODEL_FSL_MPIC_20:
> > +        kvm_openpic_model = KVM_DEV_TYPE_FSL_MPIC_20;
> > +        break;
> > +
> > +    case OPENPIC_MODEL_FSL_MPIC_42:
> > +        kvm_openpic_model = KVM_DEV_TYPE_FSL_MPIC_42;
> > +        break;
> > +
> > +    default:
> > +        return -EINVAL;
> > +    }
> 
> If there's only two supported enum-style options, why not make it two
> devices with the value set as a class field?

I'm not 100% sure what you mean here, but it is not intended that there  
will always be only two supported options.  At the least we will  
probably support v4.3 at some point.

-Scott

  reply	other threads:[~2013-06-13 17:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 20:32 [Qemu-devel] [PATCH v2] kvm/openpic: in-kernel mpic support Scott Wood
2013-06-12 20:56 ` Alexander Graf
2013-06-13 11:01 ` Andreas Färber
2013-06-13 17:32   ` Scott Wood [this message]
2013-06-14 14:59     ` Andreas Färber
2013-06-14 22:57       ` Scott Wood
2013-06-16 19:11         ` Andreas Färber
2013-06-19 22:25           ` Scott Wood
2013-06-16 18:32 ` [Qemu-devel] [PATCH ppc-next fixup] intc/openpic_kvm: Fix QOM and build issues Andreas Färber
2013-06-16 19:34   ` Andreas Färber
2013-06-16 19:25 ` [Qemu-devel] [PATCH v2] kvm/openpic: in-kernel mpic support Andreas Färber
2013-06-19 21:49   ` Scott Wood
2013-07-01 16:54   ` Andreas Färber
2013-06-16 19:30 ` [Qemu-devel] [PATCH ppc-next fixup v2] intc/openpic_kvm: Fix QOM and build issues Andreas Färber
2013-06-18 12:39   ` Alexander Graf

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=1371144750.2028.14@snotra \
    --to=scottwood@freescale.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).