mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
machine: add properties to compat_props incrementaly
Switch to adding compat properties incrementaly instead of completly overwriting compat_props per machine type. That removes data duplication which we have due to nested [PC|SPAPR]_COMPAT_* macros. It also allows to set default device properties from default foo_machine_options() hook, which will be used in following patch for putting VMGENID device as a function if ISA bridge on pc/q35 machines. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> [ehabkost: Fixed CCW_COMPAT_* and PC_COMPAT_0_* defines] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
16714b1680
commit
bacc344c54
8 changed files with 24 additions and 34 deletions
|
@ -571,6 +571,15 @@ bool machine_mem_merge(MachineState *machine)
|
|||
return machine->mem_merge;
|
||||
}
|
||||
|
||||
static void machine_class_finalize(ObjectClass *klass, void *data)
|
||||
{
|
||||
MachineClass *mc = MACHINE_CLASS(klass);
|
||||
|
||||
if (mc->compat_props) {
|
||||
g_array_free(mc->compat_props, true);
|
||||
}
|
||||
}
|
||||
|
||||
static const TypeInfo machine_info = {
|
||||
.name = TYPE_MACHINE,
|
||||
.parent = TYPE_OBJECT,
|
||||
|
@ -578,6 +587,7 @@ static const TypeInfo machine_info = {
|
|||
.class_size = sizeof(MachineClass),
|
||||
.class_init = machine_class_init,
|
||||
.class_base_init = machine_class_base_init,
|
||||
.class_finalize = machine_class_finalize,
|
||||
.instance_size = sizeof(MachineState),
|
||||
.instance_init = machine_initfn,
|
||||
.instance_finalize = machine_finalize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue