diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-12-02 01:23:27 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-01-07 16:18:42 +0400 |
commit | 1c3994f6d2afa1ced3058aa707d43e44ca96cfc8 (patch) | |
tree | 706a7e957773eb16dcb460252b50acec28ab14a7 /hw/core | |
parent | a310e653ce0e3effc9a27c3b10018d2d29bf566c (diff) | |
download | qemu-1c3994f6d2afa1ced3058aa707d43e44ca96cfc8.zip qemu-1c3994f6d2afa1ced3058aa707d43e44ca96cfc8.tar.gz qemu-1c3994f6d2afa1ced3058aa707d43e44ca96cfc8.tar.bz2 |
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')
-rw-r--r-- | hw/core/qdev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index d510340..3769a2b 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)); } |