From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLqGl-0004DA-AN for qemu-devel@nongnu.org; Fri, 07 Mar 2014 03:36:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLqGe-0003DN-2v for qemu-devel@nongnu.org; Fri, 07 Mar 2014 03:36:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLqGd-0003C0-Qi for qemu-devel@nongnu.org; Fri, 07 Mar 2014 03:36:32 -0500 Message-ID: <53198507.8010904@redhat.com> Date: Fri, 07 Mar 2014 09:36:23 +0100 From: Paolo Bonzini 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=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable 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: =?ISO-8859-15?Q?Andreas_F=E4rber?= , Marcel Apfelbaum , qemu-devel@nongnu.org, Alexey Kardashevskiy Cc: ehabkost@redhat.com, mst@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, blauwirbel@gmail.com, aliguori@amazon.com, imammedo@redhat.com Il 07/03/2014 00:44, Andreas F=E4rber ha scritto: > 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. > > What about the following on top? Good idea! The smallest patches are (almost) always the best. :) Paolo > 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. > > 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 =3D=3D NULL) { > - dev =3D container_get(object_get_root(), "/machine"); > + dev =3D object_resolve_path("/machine", NULL); > + g_assert(dev); > } > > return dev; > >