qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 10/10] machine: Set MachineClass::name automatic


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH 10/10] machine: Set MachineClass::name automatically
Date: Wed, 26 Aug 2015 12:02:21 -0300
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> >---
> >  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]