diff options
Diffstat (limited to 'hw')
-rw-r--r-- | hw/core/qdev.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 3769a2b..47bddac 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -975,10 +975,13 @@ void object_apply_compat_props(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); + if (m->accelerator) { + 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); } |