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.lur...@redhat.com> --- include/hw/boards.h | 3 +- include/hw/qdev-core.h | 1 + hw/arm/virt.c | 16 +++++------ hw/core/machine.c | 19 +------------ hw/core/qdev.c | 9 ++++++ hw/i386/pc_piix.c | 56 +++++++++++++++++++------------------- hw/i386/pc_q35.c | 20 +++++++------- hw/ppc/spapr.c | 26 +++++++++--------- hw/s390x/s390-virtio-ccw.c | 20 +++++++------- vl.c | 2 +- 10 files changed, 82 insertions(+), 90 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index f82f28468b..28c2b0af41 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -69,7 +69,6 @@ int machine_kvm_shadow_mem(MachineState *machine); int machine_phandle_start(MachineState *machine); bool machine_dump_guest_core(MachineState *machine); bool machine_mem_merge(MachineState *machine); -void machine_register_compat_props(MachineState *machine); HotpluggableCPUList *machine_query_hotpluggable_cpus(MachineState *machine); void machine_set_cpu_numa_node(MachineState *machine, const CpuInstanceProperties *props, @@ -191,7 +190,7 @@ struct MachineClass { const char *default_machine_opts; const char *default_boot_order; const char *default_display; - GArray *compat_props; + GPtrArray *compat_props; const char *hw_version; ram_addr_t default_ram_size; const char *default_cpu_type; diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 82afd3c50d..f6a9503e23 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -279,6 +279,7 @@ typedef struct GlobalProperty { } while (0) void accel_register_compat_props(const GPtrArray *props); +void machine_register_compat_props(const GPtrArray *props); /*** Board API. This should go away once we have a machine config file. ***/ diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a2b8d8f7c2..d106a8a8c7 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1882,7 +1882,7 @@ static void virt_3_0_instance_init(Object *obj) static void virt_machine_3_0_options(MachineClass *mc) { virt_machine_3_1_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_3_0); + SET_COMPAT(mc, VIRT_COMPAT_3_0); } DEFINE_VIRT_MACHINE(3, 0) @@ -1899,7 +1899,7 @@ static void virt_machine_2_12_options(MachineClass *mc) VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); virt_machine_3_0_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_12); + SET_COMPAT(mc, VIRT_COMPAT_2_12); vmc->no_highmem_ecam = true; mc->max_cpus = 255; } @@ -1918,7 +1918,7 @@ static void virt_machine_2_11_options(MachineClass *mc) VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); virt_machine_2_12_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_11); + SET_COMPAT(mc, VIRT_COMPAT_2_11); vmc->smbios_old_sys_ver = true; } DEFINE_VIRT_MACHINE(2, 11) @@ -1934,7 +1934,7 @@ static void virt_2_10_instance_init(Object *obj) static void virt_machine_2_10_options(MachineClass *mc) { virt_machine_2_11_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_10); + SET_COMPAT(mc, VIRT_COMPAT_2_10); /* before 2.11 we never faulted accesses to bad addresses */ mc->ignore_memory_transaction_failures = true; } @@ -1951,7 +1951,7 @@ static void virt_2_9_instance_init(Object *obj) static void virt_machine_2_9_options(MachineClass *mc) { virt_machine_2_10_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_9); + SET_COMPAT(mc, VIRT_COMPAT_2_9); } DEFINE_VIRT_MACHINE(2, 9) @@ -1968,7 +1968,7 @@ static void virt_machine_2_8_options(MachineClass *mc) VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); virt_machine_2_9_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_8); + SET_COMPAT(mc, VIRT_COMPAT_2_8); /* For 2.8 and earlier we falsely claimed in the DT that * our timers were edge-triggered, not level-triggered. */ @@ -1989,7 +1989,7 @@ static void virt_machine_2_7_options(MachineClass *mc) VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); virt_machine_2_8_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_7); + SET_COMPAT(mc, VIRT_COMPAT_2_7); /* ITS was introduced with 2.8 */ vmc->no_its = true; /* Stick with 1K pages for migration compatibility */ @@ -2010,7 +2010,7 @@ static void virt_machine_2_6_options(MachineClass *mc) VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); virt_machine_2_7_options(mc); - SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_6); + SET_COMPAT(mc, VIRT_COMPAT_2_6); vmc->disallow_affinity_adjustment = true; /* Disable PMU for 2.6 as PMU support was first introduced in 2.7 */ vmc->no_pmu = true; diff --git a/hw/core/machine.c b/hw/core/machine.c index c51423b647..6e24924aba 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -647,6 +647,7 @@ static void machine_class_base_init(ObjectClass *oc, void *data) assert(g_str_has_suffix(cname, TYPE_MACHINE_SUFFIX)); mc->name = g_strndup(cname, strlen(cname) - strlen(TYPE_MACHINE_SUFFIX)); + mc->compat_props = g_ptr_array_new(); } } @@ -834,24 +835,6 @@ void machine_run_board_init(MachineState *machine) machine_class->init(machine); } -void machine_register_compat_props(MachineState *machine) -{ - MachineClass *mc = MACHINE_GET_CLASS(machine); - int i; - GlobalProperty *p; - - if (!mc->compat_props) { - return; - } - - for (i = 0; i < mc->compat_props->len; i++) { - p = g_array_index(mc->compat_props, GlobalProperty *, i); - /* Machine compat_props must never cause errors: */ - p->errp = &error_abort; - qdev_prop_register_global(p); - } -} - static const TypeInfo machine_info = { .name = TYPE_MACHINE, .parent = TYPE_OBJECT, diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 7066d28271..3b31b2c025 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -971,17 +971,26 @@ static void device_initfn(Object *obj) } static const GPtrArray *ac_compat_props; +static const GPtrArray *mc_compat_props; void accel_register_compat_props(const GPtrArray *props) { ac_compat_props = props; } +void machine_register_compat_props(const GPtrArray *props) +{ + mc_compat_props = props; +} + static void device_post_init(Object *obj) { if (ac_compat_props) { object_apply_global_props(obj, ac_compat_props, &error_abort); } + if (mc_compat_props) { + object_apply_global_props(obj, mc_compat_props, &error_abort); + } qdev_prop_set_globals(DEVICE(obj)); } diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7092d6d13f..3cc92b8eec 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -443,7 +443,7 @@ static void pc_i440fx_3_0_machine_options(MachineClass *m) pc_i440fx_3_1_machine_options(m); m->is_default = 0; m->alias = NULL; - SET_MACHINE_COMPAT(m, PC_COMPAT_3_0); + SET_COMPAT(m, PC_COMPAT_3_0); } DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL, @@ -452,7 +452,7 @@ DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL, static void pc_i440fx_2_12_machine_options(MachineClass *m) { pc_i440fx_3_0_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_12); + SET_COMPAT(m, PC_COMPAT_2_12); } DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL, @@ -461,7 +461,7 @@ DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL, static void pc_i440fx_2_11_machine_options(MachineClass *m) { pc_i440fx_2_12_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_11); + SET_COMPAT(m, PC_COMPAT_2_11); } DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL, @@ -470,7 +470,7 @@ DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL, static void pc_i440fx_2_10_machine_options(MachineClass *m) { pc_i440fx_2_11_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_10); + SET_COMPAT(m, PC_COMPAT_2_10); m->auto_enable_numa_with_memhp = false; } @@ -480,7 +480,7 @@ DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL, static void pc_i440fx_2_9_machine_options(MachineClass *m) { pc_i440fx_2_10_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_9); + SET_COMPAT(m, PC_COMPAT_2_9); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; } @@ -490,7 +490,7 @@ DEFINE_I440FX_MACHINE(v2_9, "pc-i440fx-2.9", NULL, static void pc_i440fx_2_8_machine_options(MachineClass *m) { pc_i440fx_2_9_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_8); + SET_COMPAT(m, PC_COMPAT_2_8); } DEFINE_I440FX_MACHINE(v2_8, "pc-i440fx-2.8", NULL, @@ -500,7 +500,7 @@ DEFINE_I440FX_MACHINE(v2_8, "pc-i440fx-2.8", NULL, static void pc_i440fx_2_7_machine_options(MachineClass *m) { pc_i440fx_2_8_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_7); + SET_COMPAT(m, PC_COMPAT_2_7); } DEFINE_I440FX_MACHINE(v2_7, "pc-i440fx-2.7", NULL, @@ -513,7 +513,7 @@ static void pc_i440fx_2_6_machine_options(MachineClass *m) pc_i440fx_2_7_machine_options(m); pcmc->legacy_cpu_hotplug = true; pcmc->linuxboot_dma_enabled = false; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_6); + SET_COMPAT(m, PC_COMPAT_2_6); } DEFINE_I440FX_MACHINE(v2_6, "pc-i440fx-2.6", NULL, @@ -526,7 +526,7 @@ static void pc_i440fx_2_5_machine_options(MachineClass *m) pc_i440fx_2_6_machine_options(m); pcmc->save_tsc_khz = false; m->legacy_fw_cfg_order = 1; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_5); + SET_COMPAT(m, PC_COMPAT_2_5); } DEFINE_I440FX_MACHINE(v2_5, "pc-i440fx-2.5", NULL, @@ -539,7 +539,7 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m) pc_i440fx_2_5_machine_options(m); m->hw_version = "2.4.0"; pcmc->broken_reserved_end = true; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_4); + SET_COMPAT(m, PC_COMPAT_2_4); } DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL, @@ -550,7 +550,7 @@ static void pc_i440fx_2_3_machine_options(MachineClass *m) { pc_i440fx_2_4_machine_options(m); m->hw_version = "2.3.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_3); + SET_COMPAT(m, PC_COMPAT_2_3); } DEFINE_I440FX_MACHINE(v2_3, "pc-i440fx-2.3", pc_compat_2_3, @@ -562,7 +562,7 @@ static void pc_i440fx_2_2_machine_options(MachineClass *m) PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_i440fx_2_3_machine_options(m); m->hw_version = "2.2.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_2); + SET_COMPAT(m, PC_COMPAT_2_2); pcmc->rsdp_in_ram = false; } @@ -576,7 +576,7 @@ static void pc_i440fx_2_1_machine_options(MachineClass *m) pc_i440fx_2_2_machine_options(m); m->hw_version = "2.1.0"; m->default_display = NULL; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_1); + SET_COMPAT(m, PC_COMPAT_2_1); pcmc->smbios_uuid_encoded = false; pcmc->enforce_aligned_dimm = false; } @@ -591,7 +591,7 @@ static void pc_i440fx_2_0_machine_options(MachineClass *m) PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_i440fx_2_1_machine_options(m); m->hw_version = "2.0.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_0); + SET_COMPAT(m, PC_COMPAT_2_0); pcmc->smbios_legacy_mode = true; pcmc->has_reserved_memory = false; /* This value depends on the actual DSDT and SSDT compiled into @@ -625,7 +625,7 @@ static void pc_i440fx_1_7_machine_options(MachineClass *m) m->hw_version = "1.7.0"; m->default_machine_opts = NULL; m->option_rom_has_mr = true; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_7); + SET_COMPAT(m, PC_COMPAT_1_7); pcmc->smbios_defaults = false; pcmc->gigabyte_align = false; pcmc->legacy_acpi_table_size = 6414; @@ -641,7 +641,7 @@ static void pc_i440fx_1_6_machine_options(MachineClass *m) pc_i440fx_1_7_machine_options(m); m->hw_version = "1.6.0"; m->rom_file_has_mr = false; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_6); + SET_COMPAT(m, PC_COMPAT_1_6); pcmc->has_acpi_build = false; } @@ -653,7 +653,7 @@ static void pc_i440fx_1_5_machine_options(MachineClass *m) { pc_i440fx_1_6_machine_options(m); m->hw_version = "1.5.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_5); + SET_COMPAT(m, PC_COMPAT_1_5); } DEFINE_I440FX_MACHINE(v1_5, "pc-i440fx-1.5", pc_compat_1_5, @@ -665,7 +665,7 @@ static void pc_i440fx_1_4_machine_options(MachineClass *m) pc_i440fx_1_5_machine_options(m); m->hw_version = "1.4.0"; m->hot_add_cpu = NULL; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_4); + SET_COMPAT(m, PC_COMPAT_1_4); } DEFINE_I440FX_MACHINE(v1_4, "pc-i440fx-1.4", pc_compat_1_4, @@ -697,7 +697,7 @@ static void pc_i440fx_1_3_machine_options(MachineClass *m) { pc_i440fx_1_4_machine_options(m); m->hw_version = "1.3.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_3); + SET_COMPAT(m, PC_COMPAT_1_3); } DEFINE_I440FX_MACHINE(v1_3, "pc-1.3", pc_compat_1_3, @@ -736,7 +736,7 @@ static void pc_i440fx_1_2_machine_options(MachineClass *m) { pc_i440fx_1_3_machine_options(m); m->hw_version = "1.2.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_2); + SET_COMPAT(m, PC_COMPAT_1_2); } DEFINE_I440FX_MACHINE(v1_2, "pc-1.2", pc_compat_1_2, @@ -779,7 +779,7 @@ static void pc_i440fx_1_1_machine_options(MachineClass *m) { pc_i440fx_1_2_machine_options(m); m->hw_version = "1.1.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_1); + SET_COMPAT(m, PC_COMPAT_1_1); } DEFINE_I440FX_MACHINE(v1_1, "pc-1.1", pc_compat_1_2, @@ -810,7 +810,7 @@ static void pc_i440fx_1_0_machine_options(MachineClass *m) { pc_i440fx_1_1_machine_options(m); m->hw_version = "1.0"; - SET_MACHINE_COMPAT(m, PC_COMPAT_1_0); + SET_COMPAT(m, PC_COMPAT_1_0); } DEFINE_I440FX_MACHINE(v1_0, "pc-1.0", pc_compat_1_2, @@ -824,7 +824,7 @@ static void pc_i440fx_0_15_machine_options(MachineClass *m) { pc_i440fx_1_0_machine_options(m); m->hw_version = "0.15"; - SET_MACHINE_COMPAT(m, PC_COMPAT_0_15); + SET_COMPAT(m, PC_COMPAT_0_15); } DEFINE_I440FX_MACHINE(v0_15, "pc-0.15", pc_compat_1_2, @@ -863,7 +863,7 @@ static void pc_i440fx_0_14_machine_options(MachineClass *m) { pc_i440fx_0_15_machine_options(m); m->hw_version = "0.14"; - SET_MACHINE_COMPAT(m, PC_COMPAT_0_14); + SET_COMPAT(m, PC_COMPAT_0_14); } DEFINE_I440FX_MACHINE(v0_14, "pc-0.14", pc_compat_1_2, @@ -899,7 +899,7 @@ static void pc_i440fx_0_13_machine_options(MachineClass *m) PCMachineClass *pcmc = PC_MACHINE_CLASS(m); pc_i440fx_0_14_machine_options(m); m->hw_version = "0.13"; - SET_MACHINE_COMPAT(m, PC_COMPAT_0_13); + SET_COMPAT(m, PC_COMPAT_0_13); pcmc->kvmclock_enabled = false; } @@ -935,7 +935,7 @@ static void pc_i440fx_0_12_machine_options(MachineClass *m) { pc_i440fx_0_13_machine_options(m); m->hw_version = "0.12"; - SET_MACHINE_COMPAT(m, PC_COMPAT_0_12); + SET_COMPAT(m, PC_COMPAT_0_12); } DEFINE_I440FX_MACHINE(v0_12, "pc-0.12", pc_compat_0_13, @@ -967,7 +967,7 @@ static void pc_i440fx_0_11_machine_options(MachineClass *m) pc_i440fx_0_12_machine_options(m); m->hw_version = "0.11"; m->deprecation_reason = "use a newer machine type instead"; - SET_MACHINE_COMPAT(m, PC_COMPAT_0_11); + SET_COMPAT(m, PC_COMPAT_0_11); } DEFINE_I440FX_MACHINE(v0_11, "pc-0.11", pc_compat_0_13, @@ -1002,7 +1002,7 @@ static void pc_i440fx_0_10_machine_options(MachineClass *m) { pc_i440fx_0_11_machine_options(m); m->hw_version = "0.10"; - SET_MACHINE_COMPAT(m, PC_COMPAT_0_10); + SET_COMPAT(m, PC_COMPAT_0_10); } DEFINE_I440FX_MACHINE(v0_10, "pc-0.10", pc_compat_0_13, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4702bb13c4..19e6ec6675 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -324,7 +324,7 @@ static void pc_q35_3_0_machine_options(MachineClass *m) { pc_q35_3_1_machine_options(m); m->alias = NULL; - SET_MACHINE_COMPAT(m, PC_COMPAT_3_0); + SET_COMPAT(m, PC_COMPAT_3_0); } DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL, @@ -333,7 +333,7 @@ DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL, static void pc_q35_2_12_machine_options(MachineClass *m) { pc_q35_3_0_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_12); + SET_COMPAT(m, PC_COMPAT_2_12); } DEFINE_Q35_MACHINE(v2_12, "pc-q35-2.12", NULL, @@ -345,7 +345,7 @@ static void pc_q35_2_11_machine_options(MachineClass *m) pc_q35_2_12_machine_options(m); pcmc->default_nic_model = "e1000"; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_11); + SET_COMPAT(m, PC_COMPAT_2_11); } DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL, @@ -354,7 +354,7 @@ DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL, static void pc_q35_2_10_machine_options(MachineClass *m) { pc_q35_2_11_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_10); + SET_COMPAT(m, PC_COMPAT_2_10); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; m->auto_enable_numa_with_memhp = false; } @@ -365,7 +365,7 @@ DEFINE_Q35_MACHINE(v2_10, "pc-q35-2.10", NULL, static void pc_q35_2_9_machine_options(MachineClass *m) { pc_q35_2_10_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_9); + SET_COMPAT(m, PC_COMPAT_2_9); } DEFINE_Q35_MACHINE(v2_9, "pc-q35-2.9", NULL, @@ -374,7 +374,7 @@ DEFINE_Q35_MACHINE(v2_9, "pc-q35-2.9", NULL, static void pc_q35_2_8_machine_options(MachineClass *m) { pc_q35_2_9_machine_options(m); - SET_MACHINE_COMPAT(m, PC_COMPAT_2_8); + SET_COMPAT(m, PC_COMPAT_2_8); } DEFINE_Q35_MACHINE(v2_8, "pc-q35-2.8", NULL, @@ -384,7 +384,7 @@ static void pc_q35_2_7_machine_options(MachineClass *m) { pc_q35_2_8_machine_options(m); m->max_cpus = 255; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_7); + SET_COMPAT(m, PC_COMPAT_2_7); } DEFINE_Q35_MACHINE(v2_7, "pc-q35-2.7", NULL, @@ -396,7 +396,7 @@ static void pc_q35_2_6_machine_options(MachineClass *m) pc_q35_2_7_machine_options(m); pcmc->legacy_cpu_hotplug = true; pcmc->linuxboot_dma_enabled = false; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_6); + SET_COMPAT(m, PC_COMPAT_2_6); } DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL, @@ -408,7 +408,7 @@ static void pc_q35_2_5_machine_options(MachineClass *m) pc_q35_2_6_machine_options(m); pcmc->save_tsc_khz = false; m->legacy_fw_cfg_order = 1; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_5); + SET_COMPAT(m, PC_COMPAT_2_5); } DEFINE_Q35_MACHINE(v2_5, "pc-q35-2.5", NULL, @@ -420,7 +420,7 @@ static void pc_q35_2_4_machine_options(MachineClass *m) pc_q35_2_5_machine_options(m); m->hw_version = "2.4.0"; pcmc->broken_reserved_end = true; - SET_MACHINE_COMPAT(m, PC_COMPAT_2_4); + SET_COMPAT(m, PC_COMPAT_2_4); } DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL, diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 7afd1a175b..f36554687f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3986,7 +3986,7 @@ static void spapr_machine_3_0_class_options(MachineClass *mc) sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); spapr_machine_3_1_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_0); + SET_COMPAT(mc, SPAPR_COMPAT_3_0); smc->legacy_irq_allocation = true; smc->irq = &spapr_irq_xics_legacy; @@ -4020,7 +4020,7 @@ static void spapr_machine_2_12_class_options(MachineClass *mc) sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); spapr_machine_3_0_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_12); + SET_COMPAT(mc, SPAPR_COMPAT_2_12); /* We depend on kvm_enabled() to choose a default value for the * hpt-max-page-size capability. Of course we can't do it here @@ -4066,7 +4066,7 @@ static void spapr_machine_2_11_class_options(MachineClass *mc) spapr_machine_2_12_class_options(mc); smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON; - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_11); + SET_COMPAT(mc, SPAPR_COMPAT_2_11); } DEFINE_SPAPR_MACHINE(2_11, "2.11", false); @@ -4085,7 +4085,7 @@ static void spapr_machine_2_10_instance_options(MachineState *machine) static void spapr_machine_2_10_class_options(MachineClass *mc) { spapr_machine_2_11_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_10); + SET_COMPAT(mc, SPAPR_COMPAT_2_10); } DEFINE_SPAPR_MACHINE(2_10, "2.10", false); @@ -4111,7 +4111,7 @@ static void spapr_machine_2_9_class_options(MachineClass *mc) sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); spapr_machine_2_10_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_9); + SET_COMPAT(mc, SPAPR_COMPAT_2_9); mc->numa_auto_assign_ram = numa_legacy_auto_assign_ram; smc->pre_2_10_has_unused_icps = true; smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED; @@ -4138,7 +4138,7 @@ static void spapr_machine_2_8_instance_options(MachineState *machine) static void spapr_machine_2_8_class_options(MachineClass *mc) { spapr_machine_2_9_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_8); + SET_COMPAT(mc, SPAPR_COMPAT_2_8); mc->numa_mem_align_shift = 23; } @@ -4233,7 +4233,7 @@ static void spapr_machine_2_7_class_options(MachineClass *mc) spapr_machine_2_8_class_options(mc); mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7); + SET_COMPAT(mc, SPAPR_COMPAT_2_7); smc->phb_placement = phb_placement_2_7; } @@ -4259,7 +4259,7 @@ static void spapr_machine_2_6_class_options(MachineClass *mc) { spapr_machine_2_7_class_options(mc); mc->has_hotpluggable_cpus = false; - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_6); + SET_COMPAT(mc, SPAPR_COMPAT_2_6); } DEFINE_SPAPR_MACHINE(2_6, "2.6", false); @@ -4286,7 +4286,7 @@ static void spapr_machine_2_5_class_options(MachineClass *mc) spapr_machine_2_6_class_options(mc); smc->use_ohci_by_default = true; - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_5); + SET_COMPAT(mc, SPAPR_COMPAT_2_5); } DEFINE_SPAPR_MACHINE(2_5, "2.5", false); @@ -4308,7 +4308,7 @@ static void spapr_machine_2_4_class_options(MachineClass *mc) spapr_machine_2_5_class_options(mc); smc->dr_lmb_enabled = false; - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_4); + SET_COMPAT(mc, SPAPR_COMPAT_2_4); } DEFINE_SPAPR_MACHINE(2_4, "2.4", false); @@ -4332,7 +4332,7 @@ static void spapr_machine_2_3_instance_options(MachineState *machine) static void spapr_machine_2_3_class_options(MachineClass *mc) { spapr_machine_2_4_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_3); + SET_COMPAT(mc, SPAPR_COMPAT_2_3); } DEFINE_SPAPR_MACHINE(2_3, "2.3", false); @@ -4357,7 +4357,7 @@ static void spapr_machine_2_2_instance_options(MachineState *machine) static void spapr_machine_2_2_class_options(MachineClass *mc) { spapr_machine_2_3_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_2); + SET_COMPAT(mc, SPAPR_COMPAT_2_2); } DEFINE_SPAPR_MACHINE(2_2, "2.2", false); @@ -4375,7 +4375,7 @@ static void spapr_machine_2_1_instance_options(MachineState *machine) static void spapr_machine_2_1_class_options(MachineClass *mc) { spapr_machine_2_2_class_options(mc); - SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1); + SET_COMPAT(mc, SPAPR_COMPAT_2_1); } DEFINE_SPAPR_MACHINE(2_1, "2.1", false); diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index a0615a8b35..41b72356e9 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -762,7 +762,7 @@ static void ccw_machine_3_0_class_options(MachineClass *mc) s390mc->hpage_1m_allowed = false; ccw_machine_3_1_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_3_0); + SET_COMPAT(mc, CCW_COMPAT_3_0); } DEFINE_CCW_MACHINE(3_0, "3.0", false); @@ -776,7 +776,7 @@ static void ccw_machine_2_12_instance_options(MachineState *machine) static void ccw_machine_2_12_class_options(MachineClass *mc) { ccw_machine_3_0_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_12); + SET_COMPAT(mc, CCW_COMPAT_2_12); } DEFINE_CCW_MACHINE(2_12, "2.12", false); @@ -792,7 +792,7 @@ static void ccw_machine_2_11_instance_options(MachineState *machine) static void ccw_machine_2_11_class_options(MachineClass *mc) { ccw_machine_2_12_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_11); + SET_COMPAT(mc, CCW_COMPAT_2_11); } DEFINE_CCW_MACHINE(2_11, "2.11", false); @@ -804,7 +804,7 @@ static void ccw_machine_2_10_instance_options(MachineState *machine) static void ccw_machine_2_10_class_options(MachineClass *mc) { ccw_machine_2_11_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_10); + SET_COMPAT(mc, CCW_COMPAT_2_10); } DEFINE_CCW_MACHINE(2_10, "2.10", false); @@ -823,7 +823,7 @@ static void ccw_machine_2_9_class_options(MachineClass *mc) S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); ccw_machine_2_10_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_9); + SET_COMPAT(mc, CCW_COMPAT_2_9); s390mc->css_migration_enabled = false; } DEFINE_CCW_MACHINE(2_9, "2.9", false); @@ -836,7 +836,7 @@ static void ccw_machine_2_8_instance_options(MachineState *machine) static void ccw_machine_2_8_class_options(MachineClass *mc) { ccw_machine_2_9_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_8); + SET_COMPAT(mc, CCW_COMPAT_2_8); } DEFINE_CCW_MACHINE(2_8, "2.8", false); @@ -851,7 +851,7 @@ static void ccw_machine_2_7_class_options(MachineClass *mc) s390mc->cpu_model_allowed = false; ccw_machine_2_8_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_7); + SET_COMPAT(mc, CCW_COMPAT_2_7); } DEFINE_CCW_MACHINE(2_7, "2.7", false); @@ -866,7 +866,7 @@ static void ccw_machine_2_6_class_options(MachineClass *mc) s390mc->ri_allowed = false; ccw_machine_2_7_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_6); + SET_COMPAT(mc, CCW_COMPAT_2_6); } DEFINE_CCW_MACHINE(2_6, "2.6", false); @@ -878,7 +878,7 @@ static void ccw_machine_2_5_instance_options(MachineState *machine) static void ccw_machine_2_5_class_options(MachineClass *mc) { ccw_machine_2_6_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_5); + SET_COMPAT(mc, CCW_COMPAT_2_5); } DEFINE_CCW_MACHINE(2_5, "2.5", false); @@ -890,7 +890,7 @@ static void ccw_machine_2_4_instance_options(MachineState *machine) static void ccw_machine_2_4_class_options(MachineClass *mc) { ccw_machine_2_5_class_options(mc); - SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_4); + SET_COMPAT(mc, CCW_COMPAT_2_4); } DEFINE_CCW_MACHINE(2_4, "2.4", false); diff --git a/vl.c b/vl.c index c06e94271c..943e9b6a69 100644 --- a/vl.c +++ b/vl.c @@ -2964,7 +2964,7 @@ static void user_register_global_props(void) static void register_global_properties(MachineState *ms) { accel_register_compat_props(ACCEL_GET_CLASS(ms->accelerator)->compat_props); - machine_register_compat_props(ms); + machine_register_compat_props(MACHINE_GET_CLASS(ms)->compat_props); user_register_global_props(); } -- 2.20.0.rc1