Received: from eggs.gnu.org ([2001:4830:134:3::10]:42270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcDe-0002OZ-5A for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:02:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUcDY-00018D-Hk for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:02:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUcDY-00017W-DH for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:02:24 -0400 Date: Wed, 26 Aug 2015 12:02:21 -0300 From: Eduardo Habkost Message-ID: <20150826150221.GB4230@thinpad.lan.raisama.net> References: <1440107676-17326-1-git-send-email-ehabkost@redhat.com> <1440107676-17326-11-git-send-email-ehabkost@redhat.com> <55DC2C43.10706@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DC2C43.10706@redhat.com> Subject: Re: [Qemu-devel] [PATCH 10/10] machine: Set MachineClass::name automatically List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: Marcel Apfelbaum , David Gibson , qemu-devel@nongnu.org, Andreas =?iso-8859-1?Q?F=E4rber?= On Tue, Aug 25, 2015 at 11:50:11AM +0300, Marcel Apfelbaum wrote: > On 08/21/2015 12:54 AM, Eduardo Habkost wrote: > >Now all TYPE_MACHINE subclasses use MACHINE_TYPE_NAME to generate the > >class name. So instead of requiring each subclass to set > >MachineClass::name manually, we can now set it automatically at the > >TYPE_MACHINE class_base_init() function. > > > >Signed-off-by: Eduardo Habkost > >--- > > hw/arm/vexpress.c | 2 -- > > hw/arm/virt.c | 1 - > > hw/core/machine.c | 3 +++ > > hw/ppc/mac_newworld.c | 1 - > > hw/ppc/spapr.c | 4 ---- > > hw/s390x/s390-virtio.c | 1 - > > vl.c | 1 - > > 7 files changed, 3 insertions(+), 10 deletions(-) [...] > >diff --git a/vl.c b/vl.c > >index b7ddfeb..870ee48 100644 > >--- a/vl.c > >+++ b/vl.c > >@@ -1432,7 +1432,6 @@ static void qemu_machine_class_init(ObjectClass *oc, void *data) > > { > > MachineClass *mc = MACHINE_CLASS(oc); > > QEMUMachine *qm = data; > >- mc->name = qm->name; > > mc->desc = qm->desc; > > mc->init = qm->init; > > mc->kvm_type = qm->kvm_type; > > > > Nice! > > Please forget the possible stupid question, but what happens with > *all* other machine types? Why don't we have to remove the "name" > assignment from the other machine types too? Unless I made a mistake and missed something when grepping the code, all machine-types were changed. Most of them use qemu_register_machine() (which uses qemu_machine_class_init(), changed above). -- Eduardo