diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-12-01 23:44:11 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-01-07 16:18:41 +0400 |
commit | b66bbee39f6deb28f0645760c536cbf2189a0687 (patch) | |
tree | dd227120080b44e0a4dbdcb78c296e48de7b11a9 /hw/core/qdev.c | |
parent | fa386d989d0bec0abdcd1a883853071928adcced (diff) |
hw: apply machine compat properties without touching globals
Similarly to accel properties, move compat properties out of globals
registration, and apply the machine compat properties during
device_post_init().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r-- | hw/core/qdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 53b507164f..d510340bac 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -974,11 +974,13 @@ static void device_post_init(Object *obj) { if (object_dynamic_cast(qdev_get_machine(), TYPE_MACHINE)) { MachineState *m = MACHINE(qdev_get_machine()); + MachineClass *mc = MACHINE_GET_CLASS(m); AccelClass *ac = ACCEL_GET_CLASS(m->accelerator); if (ac->compat_props) { object_apply_global_props(obj, ac->compat_props, &error_abort); } + object_apply_global_props(obj, mc->compat_props, &error_abort); } qdev_prop_set_globals(DEVICE(obj)); |