diff mbox series

[v3,03/10] qdev: Call qemu_create_machine() on user emulation

Message ID 20250102151244.59357-4-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
For system emulation, qemu_create_machine() is
called from qemu_init().
TCG accelerator always calls tcg_init_machine().
Use it to call qemu_create_machine() on user
emulation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/tcg/tcg-all.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index c2565758876..e18b0c03f71 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -35,7 +35,9 @@ 
 #include "qemu/atomic.h"
 #include "qapi/qapi-builtin-visit.h"
 #include "qemu/units.h"
-#if !defined(CONFIG_USER_ONLY)
+#if defined(CONFIG_USER_ONLY)
+#include "hw/qdev-core.h"
+#else
 #include "hw/boards.h"
 #endif
 #include "internal-common.h"
@@ -124,6 +126,10 @@  static int tcg_init_machine(MachineState *ms)
     tcg_prologue_init();
 #endif
 
+#ifdef CONFIG_USER_ONLY
+    qemu_create_machine(NULL);
+#endif
+
     return 0;
 }