summaryrefslogtreecommitdiffstats
path: root/hw/core/qdev.c
diff options
context:
space:
mode:
authorMarc-André Lureau2018-12-01 22:23:27 +0100
committerMarc-André Lureau2019-01-07 13:18:42 +0100
commit1c3994f6d2afa1ced3058aa707d43e44ca96cfc8 (patch)
tree706a7e957773eb16dcb460252b50acec28ab14a7 /hw/core/qdev.c
parentcompat: remove remaining PC_COMPAT macros (diff)
downloadqemu-1c3994f6d2afa1ced3058aa707d43e44ca96cfc8.tar.gz
qemu-1c3994f6d2afa1ced3058aa707d43e44ca96cfc8.tar.xz
qemu-1c3994f6d2afa1ced3058aa707d43e44ca96cfc8.zip
qdev: make a separate helper function to apply compat properties
This will allow to apply compat properties on other objects than QDev easily. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r--hw/core/qdev.c6
1 files changed, 5 insertions, 1 deletions
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));
}