aboutsummaryrefslogtreecommitdiff
path: root/hw/core/qdev.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-12-01 23:44:11 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-07 16:18:41 +0400
commitb66bbee39f6deb28f0645760c536cbf2189a0687 (patch)
treedd227120080b44e0a4dbdcb78c296e48de7b11a9 /hw/core/qdev.c
parentfa386d989d0bec0abdcd1a883853071928adcced (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.c2
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));