mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
hw: apply accel compat properties without touching globals
Instead of registering compat properties as globals, let's keep them in their own array, to avoid mixing with user globals. Introduce object_apply_global_props() function, to apply compatibility properties from a GPtrArray. 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>
This commit is contained in:
parent
e59dbbac03
commit
ea9ce8934c
8 changed files with 54 additions and 19 deletions
|
@ -972,6 +972,15 @@ static void device_initfn(Object *obj)
|
|||
|
||||
static void device_post_init(Object *obj)
|
||||
{
|
||||
if (object_dynamic_cast(qdev_get_machine(), TYPE_MACHINE)) {
|
||||
MachineState *m = MACHINE(qdev_get_machine());
|
||||
AccelClass *ac = ACCEL_GET_CLASS(m->accelerator);
|
||||
|
||||
if (ac->compat_props) {
|
||||
object_apply_global_props(obj, ac->compat_props, &error_abort);
|
||||
}
|
||||
}
|
||||
|
||||
qdev_prop_set_globals(DEVICE(obj));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue