diff mbox series

[v3,01/10] qdev: Expose qemu_create_machine()

Message ID 20250102151244.59357-2-philmd@linaro.org
State New
Headers show
Series QOM: container_get() removal | expand

Commit Message

Philippe Mathieu-Daudé Jan. 2, 2025, 3:12 p.m. UTC
We need to create a 'fake' machine container for the
QOM API. We already have the system implementation
for qemu_create_machine(). Expose its prototype to
be able to add the user implementation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/qdev-core.h | 2 ++
 system/vl.c            | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index e6ef80b7fd0..bf8a0ee6486 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -1106,6 +1106,8 @@  void device_listener_unregister(DeviceListener *listener);
  */
 bool qdev_should_hide_device(const QDict *opts, bool from_json, Error **errp);
 
+void qemu_create_machine(QDict *qdict);
+
 typedef enum MachineInitPhase {
     /* current_machine is NULL.  */
     PHASE_NO_MACHINE,
diff --git a/system/vl.c b/system/vl.c
index 0843b7ab49b..33fbb9f32f3 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -28,6 +28,7 @@ 
 #include "qemu/units.h"
 #include "exec/cpu-common.h"
 #include "exec/page-vary.h"
+#include "hw/qdev-core.h"
 #include "hw/qdev-properties.h"
 #include "qapi/compat-policy.h"
 #include "qapi/error.h"
@@ -2128,7 +2129,7 @@  static void qemu_create_machine_containers(Object *machine)
     }
 }
 
-static void qemu_create_machine(QDict *qdict)
+void qemu_create_machine(QDict *qdict)
 {
     MachineClass *machine_class = select_machine(qdict, &error_fatal);
     object_set_machine_compat_props(machine_class->compat_props);