All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
	"Marcel Apfelbaum" <marcel.a@redhat.com>,
	qemu-devel@nongnu.org, "Don Slutz" <dslutz@verizon.com>,
	"Alexander Graf" <agraf@suse.de>,
	"Anthony Liguori" <aliguori@amazon.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [RFC] pc: Register machine classes directly instead of using QEMUMachine
Date: Thu, 12 Jun 2014 10:38:01 +0200	[thread overview]
Message-ID: <20140612103801.4f97701f@nial.usersys.redhat.com> (raw)
In-Reply-To: <20140612082005.GB19816@redhat.com>

On Thu, 12 Jun 2014 11:20:05 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Thu, Jun 12, 2014 at 11:12:01AM +0300, Marcel Apfelbaum wrote:
> > On Thu, 2014-06-12 at 10:02 +0200, Igor Mammedov wrote:
> > > On Thu, 12 Jun 2014 03:22:24 -0300
> > > Eduardo Habkost <ehabkost@redhat.com> wrote:
> > > 
> > > > This is a (mostly) blind and mechanical conversion of the PC QEMUMachine
> > > > definitions to corresponding class registration code.
> > > > 
> > > > Having the PC code converted to pure QOM registration code will help us
> > > > move PC-specific machine state that is currently held in static
> > > > variables inside PC machine objects, and reduce duplication between
> > > > pc_piix.c and pc_q35.c.
> > > 
> > > Getting rid of *_machine_options() functions and doing nested
> > > inheritance with necessary overrides in respective *_class_init()
> > > functions, would make code more readable/understandable.
> > While I agree with you that this is the right direction, Eduardo's
> > patch is a good step forward getting rid of QEMUMachine and those
> > defines. I say we implement the hierarchy on top of this patch.
> 
> If we add code as an intermediate step that's fine,
> but I'd like to see the whole thing before applying.
> There should be net reduction in amount of
> boilerplate code at the end of the day.
+1

> 
> 
> 
> 
> > > 
> > > > 
> > > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > > > ---
> > > >  hw/i386/pc.c         |  13 ++
> > > >  hw/i386/pc_piix.c    | 473 +++++++++++++++++++++++++++++++++++----------------
> > > >  hw/i386/pc_q35.c     | 171 +++++++++++++------
> > > >  include/hw/i386/pc.h |  20 ++-
> > > >  4 files changed, 465 insertions(+), 212 deletions(-)
> > > > 
> > > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > > > index 32d1632..56720cd 100644
> > > > --- a/hw/i386/pc.c
> > > > +++ b/hw/i386/pc.c
> > > > @@ -1456,3 +1456,16 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name)
> > > >          gsi_state->ioapic_irq[i] = qdev_get_gpio_in(dev, i);
> > > >      }
> > > >  }
> > > > +
> > > > +static TypeInfo pc_machine_type_info = {
> > > > +        .name       = TYPE_PC_MACHINE,
> > > > +        .parent     = TYPE_MACHINE,
> > > > +        .abstract   = true,
> > > > +};
> > Igor's series already introduces TYPE_PC_MACHINE, you may want to rebase on it:
> > http://lists.gnu.org/archive/html/qemu-devel/2014-06/msg00133.html
> > 
> > Thanks,
> > Marcel
> > 

  reply	other threads:[~2014-06-12  8:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12  6:22 [Qemu-devel] [RFC] pc: Register machine classes directly instead of using QEMUMachine Eduardo Habkost
2014-06-12  8:02 ` Igor Mammedov
2014-06-12  8:12   ` Marcel Apfelbaum
2014-06-12  8:20     ` Michael S. Tsirkin
2014-06-12  8:38       ` Igor Mammedov [this message]
2014-06-12  8:23     ` Igor Mammedov
2014-06-12  8:13 ` Michael S. Tsirkin
2014-06-12  8:37   ` Igor Mammedov
2014-06-12  8:49     ` Michael S. Tsirkin
2014-06-13  6:08     ` Eduardo Habkost

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=20140612103801.4f97701f@nial.usersys.redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=dslutz@verizon.com \
    --cc=ehabkost@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.