From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLhyO-0004h2-81 for qemu-devel@nongnu.org; Thu, 06 Mar 2014 18:45:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLhyG-0006tE-Ur for qemu-devel@nongnu.org; Thu, 06 Mar 2014 18:45:08 -0500 Received: from cantor2.suse.de ([195.135.220.15]:56466 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLhyG-0006t1-Ns for qemu-devel@nongnu.org; Thu, 06 Mar 2014 18:45:00 -0500 Message-ID: <5319087A.3090403@suse.de> Date: Fri, 07 Mar 2014 00:44:58 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= 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> In-Reply-To: <1394040647-20083-4-git-send-email-marcel.a@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 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: 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, pbonzini@redhat.com, imammedo@redhat.com 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. >=20 > 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? 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; --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg