From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLjOk-0006pL-3D for qemu-devel@nongnu.org; Thu, 06 Mar 2014 20:16:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLjOc-0001mO-HZ for qemu-devel@nongnu.org; Thu, 06 Mar 2014 20:16:26 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:40813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLjOc-0001mI-Cq for qemu-devel@nongnu.org; Thu, 06 Mar 2014 20:16:18 -0500 Received: by mail-pa0-f43.google.com with SMTP id bj1so3416974pad.16 for ; Thu, 06 Mar 2014 17:16:17 -0800 (PST) Message-ID: <53191DD9.2020009@ozlabs.ru> Date: Fri, 07 Mar 2014 12:16:09 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1394040647-20083-1-git-send-email-marcel.a@redhat.com> <1394040647-20083-4-git-send-email-marcel.a@redhat.com> <5319087A.3090403@suse.de> In-Reply-To: <5319087A.3090403@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Marcel Apfelbaum , qemu-devel@nongnu.org Cc: ehabkost@redhat.com, mst@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, blauwirbel@gmail.com, aliguori@amazon.com, pbonzini@redhat.com, imammedo@redhat.com 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 > > 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? > 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?)? > 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; > > -- Alexey