qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 02/10] qdev: Implement qemu_create_machine() for user emulatio


From: Philippe Mathieu-Daudé
Subject: [PATCH v3 02/10] qdev: Implement qemu_create_machine() for user emulation
Date: Thu, 2 Jan 2025 16:12:36 +0100

To satisfy QOM containers design, implement qemu_create_machine()
for user emulation, creating a 'fake' machine.

Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/core/qdev-user-stubs.c | 11 +++++++++++
 hw/core/meson.build       |  1 +
 2 files changed, 12 insertions(+)
 create mode 100644 hw/core/qdev-user-stubs.c

diff --git a/hw/core/qdev-user-stubs.c b/hw/core/qdev-user-stubs.c
new file mode 100644
index 00000000000..9d481a61dbf
--- /dev/null
+++ b/hw/core/qdev-user-stubs.c
@@ -0,0 +1,11 @@
+#include "qemu/osdep.h"
+#include "hw/qdev-core.h"
+
+void qemu_create_machine(QDict *qdict)
+{
+    Object *fake_machine_obj;
+
+    fake_machine_obj = object_property_add_new_container(object_get_root(),
+                                                         "machine");
+    object_property_add_new_container(fake_machine_obj, "unattached");
+}
diff --git a/hw/core/meson.build b/hw/core/meson.build
index ce9dfa3f4bf..0f020fed1df 100644
--- a/hw/core/meson.build
+++ b/hw/core/meson.build
@@ -46,3 +46,4 @@ system_ss.add(files(
   'vm-change-state-handler.c',
   'clock-vmstate.c',
 ))
+user_ss.add(files('qdev-user-stubs.c'))
-- 
2.47.1




reply via email to

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