From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv0WS-0007E7-HG for qemu-devel@nongnu.org; Thu, 12 Jun 2014 04:38:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv0WN-0005K5-Jj for qemu-devel@nongnu.org; Thu, 12 Jun 2014 04:38:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv0WN-0005JU-6m for qemu-devel@nongnu.org; Thu, 12 Jun 2014 04:38:07 -0400 Date: Thu, 12 Jun 2014 10:38:01 +0200 From: Igor Mammedov Message-ID: <20140612103801.4f97701f@nial.usersys.redhat.com> In-Reply-To: <20140612082005.GB19816@redhat.com> References: <1402554144-17545-1-git-send-email-ehabkost@redhat.com> <20140612100224.7cf8ce4c@nial.usersys.redhat.com> <1402560721.24256.4.camel@localhost.localdomain> <20140612082005.GB19816@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] pc: Register machine classes directly instead of using QEMUMachine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Eduardo Habkost , Marcel Apfelbaum , qemu-devel@nongnu.org, Don Slutz , Alexander Graf , Anthony Liguori , Andreas =?ISO-8859-1?B?RuRyYmVy?= On Thu, 12 Jun 2014 11:20:05 +0300 "Michael S. Tsirkin" 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 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 > > > > --- > > > > 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 > >