qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel.a@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: ehabkost@redhat.com, mst@redhat.com, qemu-devel@nongnu.org,
	armbru@redhat.com, lcapitulino@redhat.com, blauwirbel@gmail.com,
	aliguori@amazon.com, pbonzini@redhat.com, imammedo@redhat.com,
	"Andreas Färber" <afaerber@suse.de>
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	[thread overview]
Message-ID: <1394170851.2663.30.camel@localhost.localdomain> (raw)
In-Reply-To: <53191DD9.2020009@ozlabs.ru>

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 <marcel.a@redhat.com>
> > 
> > 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;
> > 
> > 
> 
> 

  reply	other threads:[~2014-03-07  5:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 17:30 [Qemu-devel] [PATCH v3 0/3] qemu-machine as a QOM object Marcel Apfelbaum
2014-03-05 17:30 ` [Qemu-devel] [PATCH v3 1/3] hw/core: introduced qemu machine as " Marcel Apfelbaum
2014-03-06 22:43   ` Andreas Färber
2014-03-07 11:31   ` Andreas Färber
2014-03-05 17:30 ` [Qemu-devel] [PATCH v3 2/3] vl: use qemu machine QOM class instead of global machines list Marcel Apfelbaum
2014-03-06 22:55   ` Andreas Färber
2014-03-05 17:30 ` [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass Marcel Apfelbaum
2014-03-05 17:36   ` Eric Blake
2014-03-05 17:59     ` Marcel Apfelbaum
2014-03-06 23:44   ` Andreas Färber
2014-03-07  1:16     ` Alexey Kardashevskiy
2014-03-07  5:40       ` Marcel Apfelbaum [this message]
2014-03-07  5:32     ` Marcel Apfelbaum
2014-03-07 11:27       ` Andreas Färber
2014-03-07 16:22         ` Marcel Apfelbaum
2014-03-07 16:27           ` Paolo Bonzini
2014-03-07 17:30           ` Andreas Färber
2014-03-07 20:41             ` Marcel Apfelbaum
2014-03-11 15:44             ` Marcel Apfelbaum
2014-03-11 16:48           ` Andreas Färber
2014-03-11 19:28             ` Marcel Apfelbaum
2014-03-07  8:36     ` Paolo Bonzini

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=1394170851.2663.30.camel@localhost.localdomain \
    --to=marcel.a@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).