[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 22/28] qdev: make a separate helper function to a
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v6 22/28] qdev: make a separate helper function to apply compat properties |
Date: |
Thu, 13 Dec 2018 01:48:44 +0400 |
This will allow to apply compat properties on other objects than QDev easily.
Signed-off-by: Marc-André Lureau <address@hidden>
---
include/hw/qdev-core.h | 2 ++
hw/core/qdev.c | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 84e612f473..5989fb6565 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -422,6 +422,8 @@ const char *qdev_fw_name(DeviceState *dev);
Object *qdev_get_machine(void);
+void object_apply_compat_props(Object *obj);
+
/* FIXME: make this a link<> */
void qdev_set_parent_bus(DeviceState *dev, BusState *bus);
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index d510340bac..3769a2bccb 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -970,7 +970,7 @@ static void device_initfn(Object *obj)
QLIST_INIT(&dev->gpios);
}
-static void device_post_init(Object *obj)
+void object_apply_compat_props(Object *obj)
{
if (object_dynamic_cast(qdev_get_machine(), TYPE_MACHINE)) {
MachineState *m = MACHINE(qdev_get_machine());
@@ -982,7 +982,11 @@ static void device_post_init(Object *obj)
}
object_apply_global_props(obj, mc->compat_props, &error_abort);
}
+}
+static void device_post_init(Object *obj)
+{
+ object_apply_compat_props(obj);
qdev_prop_set_globals(DEVICE(obj));
}
--
2.20.0
- [Qemu-devel] [PATCH v6 11/28] compat: replace PC_COMPAT_2_9 & HW_COMPAT_2_9 macros, (continued)
- [Qemu-devel] [PATCH v6 11/28] compat: replace PC_COMPAT_2_9 & HW_COMPAT_2_9 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 12/28] compat: replace PC_COMPAT_2_8 & HW_COMPAT_2_8 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 13/28] compat: replace PC_COMPAT_2_7 & HW_COMPAT_2_7 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 14/28] compat: replace PC_COMPAT_2_6 & HW_COMPAT_2_6 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 15/28] compat: replace PC_COMPAT_2_5 & HW_COMPAT_2_5 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 16/28] compat: replace PC_COMPAT_2_4 & HW_COMPAT_2_4 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 18/28] compat: replace PC_COMPAT_2_2 & HW_COMPAT_2_2 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 19/28] compat: replace PC_COMPAT_2_1 & HW_COMPAT_2_1 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 17/28] compat: replace PC_COMPAT_2_3 & HW_COMPAT_2_3 macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 20/28] include: remove compat.h, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 22/28] qdev: make a separate helper function to apply compat properties,
Marc-André Lureau <=
- [Qemu-devel] [PATCH v6 21/28] compat: remove remaining PC_COMPAT macros, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 23/28] qdev: all globals are now user-provided, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 24/28] qdev-props: convert global_props to GPtrArray, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 25/28] qdev-props: remove errp from GlobalProperty, Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 26/28] qdev-props: call object_apply_global_props(), Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 27/28] arm: replace instance_post_init(), Marc-André Lureau, 2018/12/12
- [Qemu-devel] [PATCH v6 28/28] hostmem: use object id for memory region name with >= 4.0, Marc-André Lureau, 2018/12/12
- Re: [Qemu-devel] [PATCH v6 00/28] Generalize machine compatibility properties, Cornelia Huck, 2018/12/13