[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
- [PATCH v3 00/10] QOM: container_get() removal, Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 01/10] qdev: Expose qemu_create_machine(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 03/10] qdev: Call qemu_create_machine() on user emulation, Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 02/10] qdev: Implement qemu_create_machine() for user emulation,
Philippe Mathieu-Daudé <=
- [PATCH v3 07/10] qom: Add object_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 04/10] qdev: Make qdev_get_machine() not use container_get(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 05/10] qdev: Add machine_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 06/10] qdev: Use machine_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 08/10] qom: Use object_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 09/10] qom: Remove container_get(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v3 10/10] qdev: Inline machine_containers[] in qemu_create_machine_containers(), Philippe Mathieu-Daudé, 2025/01/02
- Re: [PATCH v3 00/10] QOM: container_get() removal, Peter Xu, 2025/01/02