@samitouri / QOSamiQemu / commits / 50362dd65a

qom: Declare compat properties API in 'qom/compat-properties.h'

While most of QEMU files use the QOM concept, few of them use the compatibility properties API (mostly use in system emulation). Move its prototype to a new "qom/compat-properties.h" header, keeping "qom/object.h" for generic QOM. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20260325151728.45378-5-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 25, 2026 at 15:47 UTC 50362dd65a033eb88bdb7f15a5d188a0f4c756cc
13 files changed +19 -9
accel/accel-system.c
+1
@@ -25,6 +25,7 @@
25
26 #include "qemu/osdep.h"
27 #include "qemu/accel.h"
28 +#include "qom/compat-properties.h"
29 #include "qapi/qapi-commands-accelerator.h"
30 #include "monitor/monitor.h"
31 #include "hw/core/boards.h"
backends/hostmem.c
+1
@@ -18,6 +18,7 @@
18 #include "qapi/qapi-builtin-visit.h"
19 #include "qapi/visitor.h"
20 #include "qemu/config-file.h"
21 +#include "qom/compat-properties.h"
22 #include "qom/object_interfaces.h"
23 #include "qemu/mmap-alloc.h"
24 #include "qemu/madvise.h"
hw/core/machine.c
+1
@@ -21,6 +21,7 @@
21 #include "qapi/qapi-visit-machine.h"
22 #include "qapi/qapi-commands-machine.h"
23 #include "qemu/madvise.h"
24 +#include "qom/compat-properties.h"
25 #include "qom/object_interfaces.h"
26 #include "system/cpus.h"
27 #include "system/system.h"
hw/core/qdev-properties.c
+1
@@ -10,6 +10,7 @@
10 #include "qemu/units.h"
11 #include "qemu/cutils.h"
12 #include "qdev-prop-internal.h"
13 +#include "qom/compat-properties.h"
14 #include "qom/qom-qobject.h"
15
16 void qdev_prop_set_after_realize(DeviceState *dev, const char *name,
hw/core/qdev.c
+1
@@ -32,6 +32,7 @@
32 #include "qapi/visitor.h"
33 #include "qemu/error-report.h"
34 #include "qemu/option.h"
35 +#include "qom/compat-properties.h"
36 #include "hw/core/irq.h"
37 #include "hw/core/qdev-properties.h"
38 #include "hw/core/boards.h"
hw/i386/pc_q35.c
+1
@@ -56,6 +56,7 @@
56 #include "hw/usb/hcd-uhci.h"
57 #include "qapi/error.h"
58 #include "qemu/error-report.h"
59 +#include "qom/compat-properties.h"
60 #include "system/numa.h"
61 #include "hw/hyperv/vmbus-bridge.h"
62 #include "hw/mem/nvdimm.h"
include/qom/compat-properties.h
+8
@@ -29,4 +29,12 @@ typedef struct GlobalProperty {
29 bool optional;
30 } GlobalProperty;
31
32 +void object_set_machine_compat_props(GPtrArray *compat_props);
33 +void object_set_accelerator_compat_props(GPtrArray *compat_props);
34 +void object_register_sugar_prop(const char *driver, const char *prop,
35 + const char *value, bool optional);
36 +void object_apply_compat_props(Object *obj);
37 +bool object_apply_global_props(Object *obj, const GPtrArray *props,
38 + Error **errp);
39 +
40 #endif
include/qom/object.h
-8
@@ -700,14 +700,6 @@ Object *object_new_with_propv(const char *typename,
700 Error **errp,
701 va_list vargs);
702
703 -bool object_apply_global_props(Object *obj, const GPtrArray *props,
704 - Error **errp);
705 -void object_set_machine_compat_props(GPtrArray *compat_props);
706 -void object_set_accelerator_compat_props(GPtrArray *compat_props);
707 -void object_register_sugar_prop(const char *driver, const char *prop,
708 - const char *value, bool optional);
709 -void object_apply_compat_props(Object *obj);
710 -
703 /**
704 * object_set_props:
705 * @obj: the object instance to set properties on
rust/bindings/qom-sys/lib.rs
+1 -1
@@ -18,7 +18,7 @@
18 clippy::too_many_arguments
19 )]
20
21 -use glib_sys::{GHashTable, GHashTableIter, GPtrArray, GSList};
21 +use glib_sys::{GHashTable, GHashTableIter, GSList};
22 use util_sys::{Error, QDict, QObject, Visitor};
23
24 #[cfg(MESON)]
system/rtc.c
+1
@@ -28,6 +28,7 @@
28 #include "qemu/error-report.h"
29 #include "qemu/option.h"
30 #include "qemu/timer.h"
31 +#include "qom/compat-properties.h"
32 #include "qom/object.h"
33 #include "system/replay.h"
34 #include "system/system.h"
system/vl.c
+1
@@ -119,6 +119,7 @@
119 #include "qapi/string-input-visitor.h"
120 #include "qapi/opts-visitor.h"
121 #include "qapi/clone-visitor.h"
122 +#include "qom/compat-properties.h"
123 #include "qom/object_interfaces.h"
124 #include "semihosting/semihost.h"
125 #include "crypto/init.h"
target/i386/sev.c
+1
@@ -36,6 +36,7 @@
36 #include "system/reset.h"
37 #include "trace.h"
38 #include "migration/blocker.h"
39 +#include "qom/compat-properties.h"
40 #include "qom/object.h"
41 #include "monitor/monitor.h"
42 #include "monitor/hmp.h"
ui/vdagent.c
+1
@@ -5,6 +5,7 @@
5 #include "qemu/error-report.h"
6 #include "qemu/option.h"
7 #include "qemu/units.h"
8 +#include "qom/compat-properties.h"
9 #include "hw/core/qdev.h"
10 #include "hw/core/qdev-properties.h"
11 #include "migration/blocker.h"