[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to
From: |
Marcel Apfelbaum |
Subject: |
Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass |
Date: |
Fri, 07 Mar 2014 07:40:51 +0200 |
On Fri, 2014-03-07 at 12:16 +1100, Alexey Kardashevskiy wrote:
> On 03/07/2014 10:44 AM, Andreas Färber wrote:
> > Am 05.03.2014 18:30, schrieb Marcel Apfelbaum:
> >> In order to allow attaching machine options to a machine instance,
> >> current_machine is converted into MachineState.
> >> As a first step of deprecating QEMUMachine, some of the functions
> >> were modified to return MachineCLass.
> >>
> >> Signed-off-by: Marcel Apfelbaum <address@hidden>
> >
> > Looks mostly good, but same issue as Alexey's patch: We are risking
> > qdev_get_machine() creating a Container-typed /machine node.
>
> Sorry, I am not following you here. object_resolve_path() can create objects?
Hi Alexey,
No, object_resolve_path() does not create objects, the point is that the machine
is created before, you only need to get it. You don't want to risk creating
a container.
>
>
> > What about the following on top?
> >
> > Alexey, if we reach agreement here, this means for you that we can just
> > use type_register_static() in place of qemu_machine_register() to
> > register your custom machine type with interface added.
>
> I am perfectly fine with that, I just do not see what difference does it
> make and why do you still keep qemu_machine_register() (or this is in the
> plan already?)?
It is in my plan to eliminate qemu_machine_register(), however it will
take some time as it includes making changes to lots of files.
For the moment, subclassing MachineClass and registering it to QOM
will be exactly like calling qemu_machine_register().
Thanks,
Marcel
>
>
>
> > Regards,
> > Andreas
> >
> > diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> > index b6deebd..749c83a 100644
> > --- a/hw/core/qdev.c
> > +++ b/hw/core/qdev.c
> > @@ -861,7 +861,8 @@ Object *qdev_get_machine(void)
> > static Object *dev;
> >
> > if (dev == NULL) {
> > - dev = container_get(object_get_root(), "/machine");
> > + dev = object_resolve_path("/machine", NULL);
> > + g_assert(dev);
> > }
> >
> > return dev;
> >
> >
>
>
- [Qemu-devel] [PATCH v3 1/3] hw/core: introduced qemu machine as QOM object, (continued)
- [Qemu-devel] [PATCH v3 1/3] hw/core: introduced qemu machine as QOM object, Marcel Apfelbaum, 2014/03/05
- [Qemu-devel] [PATCH v3 2/3] vl: use qemu machine QOM class instead of global machines list, Marcel Apfelbaum, 2014/03/05
- [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Marcel Apfelbaum, 2014/03/05
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Eric Blake, 2014/03/05
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Andreas Färber, 2014/03/06
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Marcel Apfelbaum, 2014/03/07
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Andreas Färber, 2014/03/07
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Marcel Apfelbaum, 2014/03/07
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Paolo Bonzini, 2014/03/07
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Andreas Färber, 2014/03/07
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Marcel Apfelbaum, 2014/03/07
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Marcel Apfelbaum, 2014/03/11
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Andreas Färber, 2014/03/11
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Marcel Apfelbaum, 2014/03/11
- Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass, Paolo Bonzini, 2014/03/07