qemu-devel
[Top][All Lists]
Advanced

[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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 3/3] hw/boards: converted current_machine to be an instance of MachineCLass
Date: Fri, 07 Mar 2014 09:36:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Il 07/03/2014 00:44, Andreas Färber 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 <address@hidden>

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 == NULL) {
-        dev = container_get(object_get_root(), "/machine");
+        dev = object_resolve_path("/machine", NULL);
+        g_assert(dev);
     }

     return dev;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]