diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-12-12 18:01:23 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-01-07 16:18:41 +0400 |
commit | 88cbe0737401843c550f79f611193455c6380bcc (patch) | |
tree | 859006ff2038e0e311fa5dd137e6bf617e7c6257 | |
parent | b66bbee39f6deb28f0645760c536cbf2189a0687 (diff) |
machine: move compat properties out of globals
Move the compat arrays inside functions that use them.
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>
-rw-r--r-- | hw/arm/virt.c | 94 | ||||
-rw-r--r-- | hw/i386/pc_piix.c | 607 | ||||
-rw-r--r-- | hw/i386/pc_q35.c | 121 | ||||
-rw-r--r-- | hw/ppc/spapr.c | 254 | ||||
-rw-r--r-- | hw/s390x/s390-virtio-ccw.c | 239 | ||||
-rw-r--r-- | hw/xen/xen-common.c | 38 |
6 files changed, 637 insertions, 716 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 275ef8bc02..19bec3fe59 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1872,98 +1872,88 @@ static void virt_machine_4_0_options(MachineClass *mc) } DEFINE_VIRT_MACHINE_AS_LATEST(4, 0) -static GlobalProperty virt_compat_3_1[] = { - HW_COMPAT_3_1 -}; - static void virt_machine_3_1_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_3_1 + }; + virt_machine_4_0_options(mc); - compat_props_add(mc->compat_props, - virt_compat_3_1, G_N_ELEMENTS(virt_compat_3_1)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_VIRT_MACHINE(3, 1) -static GlobalProperty virt_compat_3_0[] = { - HW_COMPAT_3_0 -}; - static void virt_machine_3_0_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_3_0 + }; + virt_machine_3_1_options(mc); - compat_props_add(mc->compat_props, - virt_compat_3_0, G_N_ELEMENTS(virt_compat_3_0)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_VIRT_MACHINE(3, 0) -static GlobalProperty virt_compat_2_12[] = { - HW_COMPAT_2_12 -}; - static void virt_machine_2_12_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + static GlobalProperty compat[] = { + HW_COMPAT_2_12 + }; virt_machine_3_0_options(mc); - compat_props_add(mc->compat_props, - virt_compat_2_12, G_N_ELEMENTS(virt_compat_2_12)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); vmc->no_highmem_ecam = true; mc->max_cpus = 255; } DEFINE_VIRT_MACHINE(2, 12) -static GlobalProperty virt_compat_2_11[] = { - HW_COMPAT_2_11 -}; - static void virt_machine_2_11_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + static GlobalProperty compat[] = { + HW_COMPAT_2_11 + }; virt_machine_2_12_options(mc); - compat_props_add(mc->compat_props, - virt_compat_2_11, G_N_ELEMENTS(virt_compat_2_11)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); vmc->smbios_old_sys_ver = true; } DEFINE_VIRT_MACHINE(2, 11) -static GlobalProperty virt_compat_2_10[] = { - HW_COMPAT_2_10 -}; - static void virt_machine_2_10_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_10 + }; + virt_machine_2_11_options(mc); - compat_props_add(mc->compat_props, - virt_compat_2_10, G_N_ELEMENTS(virt_compat_2_10)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); /* before 2.11 we never faulted accesses to bad addresses */ mc->ignore_memory_transaction_failures = true; } DEFINE_VIRT_MACHINE(2, 10) -static GlobalProperty virt_compat_2_9[] = { - HW_COMPAT_2_9 -}; - static void virt_machine_2_9_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_9 + }; + virt_machine_2_10_options(mc); - compat_props_add(mc->compat_props, - virt_compat_2_9, G_N_ELEMENTS(virt_compat_2_9)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_VIRT_MACHINE(2, 9) -static GlobalProperty virt_compat_2_8[] = { - HW_COMPAT_2_8 -}; - static void virt_machine_2_8_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + static GlobalProperty compat[] = { + HW_COMPAT_2_8 + }; virt_machine_2_9_options(mc); - compat_props_add(mc->compat_props, - virt_compat_2_8, G_N_ELEMENTS(virt_compat_2_8)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); /* For 2.8 and earlier we falsely claimed in the DT that * our timers were edge-triggered, not level-triggered. */ @@ -1971,17 +1961,15 @@ static void virt_machine_2_8_options(MachineClass *mc) } DEFINE_VIRT_MACHINE(2, 8) -static GlobalProperty virt_compat_2_7[] = { - HW_COMPAT_2_7 -}; - static void virt_machine_2_7_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + static GlobalProperty compat[] = { + HW_COMPAT_2_7 + }; virt_machine_2_8_options(mc); - compat_props_add(mc->compat_props, - virt_compat_2_7, G_N_ELEMENTS(virt_compat_2_7)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); /* ITS was introduced with 2.8 */ vmc->no_its = true; /* Stick with 1K pages for migration compatibility */ @@ -1989,17 +1977,15 @@ static void virt_machine_2_7_options(MachineClass *mc) } DEFINE_VIRT_MACHINE(2, 7) -static GlobalProperty virt_compat_2_6[] = { - HW_COMPAT_2_6 -}; - static void virt_machine_2_6_options(MachineClass *mc) { VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); + static GlobalProperty compat[] = { + HW_COMPAT_2_6 + }; virt_machine_2_7_options(mc); - compat_props_add(mc->compat_props, - virt_compat_2_6, G_N_ELEMENTS(virt_compat_2_6)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); 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/i386/pc_piix.c b/hw/i386/pc_piix.c index a88646a711..2423428acd 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -438,218 +438,204 @@ static void pc_i440fx_4_0_machine_options(MachineClass *m) DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL, pc_i440fx_4_0_machine_options); -static GlobalProperty pc_compat_3_1[] = { - PC_COMPAT_3_1 -}; - static void pc_i440fx_3_1_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_3_1 + }; + pc_i440fx_4_0_machine_options(m); m->is_default = 0; m->alias = NULL; - compat_props_add(m->compat_props, - pc_compat_3_1, G_N_ELEMENTS(pc_compat_3_1)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL, pc_i440fx_3_1_machine_options); -static GlobalProperty pc_compat_3_0[] = { - PC_COMPAT_3_0 -}; - static void pc_i440fx_3_0_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_3_0 + }; + pc_i440fx_3_1_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_3_0, G_N_ELEMENTS(pc_compat_3_0)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", NULL, pc_i440fx_3_0_machine_options); -static GlobalProperty pc_compat_2_12[] = { - PC_COMPAT_2_12 -}; - static void pc_i440fx_2_12_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_12 + }; + pc_i440fx_3_0_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_12, G_N_ELEMENTS(pc_compat_2_12)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", NULL, pc_i440fx_2_12_machine_options); -static GlobalProperty pc_compat_2_11[] = { - PC_COMPAT_2_11 -}; - static void pc_i440fx_2_11_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_11 + }; + pc_i440fx_2_12_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_11, G_N_ELEMENTS(pc_compat_2_11)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL, pc_i440fx_2_11_machine_options); -static GlobalProperty pc_compat_2_10[] = { - PC_COMPAT_2_10 -}; - static void pc_i440fx_2_10_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_10 + }; + pc_i440fx_2_11_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_10, G_N_ELEMENTS(pc_compat_2_10)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); m->auto_enable_numa_with_memhp = false; } DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL, pc_i440fx_2_10_machine_options); -static GlobalProperty pc_compat_2_9[] = { - PC_COMPAT_2_9 -}; - static void pc_i440fx_2_9_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_9 + }; + pc_i440fx_2_10_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_9, G_N_ELEMENTS(pc_compat_2_9)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; } DEFINE_I440FX_MACHINE(v2_9, "pc-i440fx-2.9", NULL, pc_i440fx_2_9_machine_options); -static GlobalProperty pc_compat_2_8[] = { - PC_COMPAT_2_8 -}; - static void pc_i440fx_2_8_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_8 + }; + pc_i440fx_2_9_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_8, G_N_ELEMENTS(pc_compat_2_8)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_8, "pc-i440fx-2.8", NULL, pc_i440fx_2_8_machine_options); -static GlobalProperty pc_compat_2_7[] = { - PC_COMPAT_2_7 -}; - static void pc_i440fx_2_7_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_7 + }; + pc_i440fx_2_8_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_7, G_N_ELEMENTS(pc_compat_2_7)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_7, "pc-i440fx-2.7", NULL, pc_i440fx_2_7_machine_options); -static GlobalProperty pc_compat_2_6[] = { - PC_COMPAT_2_6 -}; - static void pc_i440fx_2_6_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_6 + }; + pc_i440fx_2_7_machine_options(m); pcmc->legacy_cpu_hotplug = true; pcmc->linuxboot_dma_enabled = false; - compat_props_add(m->compat_props, - pc_compat_2_6, G_N_ELEMENTS(pc_compat_2_6)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_6, "pc-i440fx-2.6", NULL, pc_i440fx_2_6_machine_options); -static GlobalProperty pc_compat_2_5[] = { - PC_COMPAT_2_5 -}; - static void pc_i440fx_2_5_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_5 + }; + pc_i440fx_2_6_machine_options(m); pcmc->save_tsc_khz = false; m->legacy_fw_cfg_order = 1; - compat_props_add(m->compat_props, - pc_compat_2_5, G_N_ELEMENTS(pc_compat_2_5)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_5, "pc-i440fx-2.5", NULL, pc_i440fx_2_5_machine_options); -static GlobalProperty pc_compat_2_4[] = { - PC_COMPAT_2_4 -}; - static void pc_i440fx_2_4_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_4 + }; + pc_i440fx_2_5_machine_options(m); m->hw_version = "2.4.0"; pcmc->broken_reserved_end = true; - compat_props_add(m->compat_props, - pc_compat_2_4, G_N_ELEMENTS(pc_compat_2_4)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL, pc_i440fx_2_4_machine_options) -static GlobalProperty pc_compatp_2_3[] = { - PC_COMPAT_2_3 -}; - static void pc_i440fx_2_3_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_3 + }; + pc_i440fx_2_4_machine_options(m); m->hw_version = "2.3.0"; - compat_props_add(m->compat_props, - pc_compatp_2_3, G_N_ELEMENTS(pc_compatp_2_3)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v2_3, "pc-i440fx-2.3", pc_compat_2_3, pc_i440fx_2_3_machine_options); -static GlobalProperty pc_compatp_2_2[] = { - PC_COMPAT_2_2 -}; - static void pc_i440fx_2_2_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_2 + }; + pc_i440fx_2_3_machine_options(m); m->hw_version = "2.2.0"; m->default_machine_opts = "firmware=bios-256k.bin,suppress-vmdesc=on"; - compat_props_add(m->compat_props, - pc_compatp_2_2, G_N_ELEMENTS(pc_compatp_2_2)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); pcmc->rsdp_in_ram = false; } DEFINE_I440FX_MACHINE(v2_2, "pc-i440fx-2.2", pc_compat_2_2, pc_i440fx_2_2_machine_options); -static GlobalProperty pc_compatp_2_1[] = { - PC_COMPAT_2_1 -}; - static void pc_i440fx_2_1_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_1 + }; + pc_i440fx_2_2_machine_options(m); m->hw_version = "2.1.0"; m->default_display = NULL; - compat_props_add(m->compat_props, - pc_compatp_2_1, G_N_ELEMENTS(pc_compatp_2_1)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); pcmc->smbios_uuid_encoded = false; pcmc->enforce_aligned_dimm = false; } @@ -657,17 +643,16 @@ static void pc_i440fx_2_1_machine_options(MachineClass *m) DEFINE_I440FX_MACHINE(v2_1, "pc-i440fx-2.1", pc_compat_2_1, pc_i440fx_2_1_machine_options); -static GlobalProperty pc_compatp_2_0[] = { - PC_COMPAT_2_0 -}; - static void pc_i440fx_2_0_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_0 + }; + pc_i440fx_2_1_machine_options(m); m->hw_version = "2.0.0"; - compat_props_add(m->compat_props, - pc_compatp_2_0, G_N_ELEMENTS(pc_compatp_2_0)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); pcmc->smbios_legacy_mode = true; pcmc->has_reserved_memory = false; /* This value depends on the actual DSDT and SSDT compiled into @@ -693,19 +678,18 @@ static void pc_i440fx_2_0_machine_options(MachineClass *m) DEFINE_I440FX_MACHINE(v2_0, "pc-i440fx-2.0", pc_compat_2_0, pc_i440fx_2_0_machine_options); -static GlobalProperty pc_compatp_1_7[] = { - PC_COMPAT_1_7 -}; - static void pc_i440fx_1_7_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_1_7 + }; + pc_i440fx_2_0_machine_options(m); m->hw_version = "1.7.0"; m->default_machine_opts = NULL; m->option_rom_has_mr = true; - compat_props_add(m->compat_props, - pc_compatp_1_7, G_N_ELEMENTS(pc_compatp_1_7)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); pcmc->smbios_defaults = false; pcmc->gigabyte_align = false; pcmc->legacy_acpi_table_size = 6414; @@ -714,332 +698,321 @@ static void pc_i440fx_1_7_machine_options(MachineClass *m) DEFINE_I440FX_MACHINE(v1_7, "pc-i440fx-1.7", pc_compat_1_7, pc_i440fx_1_7_machine_options); -static GlobalProperty pc_compatp_1_6[] = { - PC_COMPAT_1_6 -}; - static void pc_i440fx_1_6_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_1_6 + }; + pc_i440fx_1_7_machine_options(m); m->hw_version = "1.6.0"; m->rom_file_has_mr = false; - compat_props_add(m->compat_props, - pc_compatp_1_6, G_N_ELEMENTS(pc_compatp_1_6)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); pcmc->has_acpi_build = false; } DEFINE_I440FX_MACHINE(v1_6, "pc-i440fx-1.6", pc_compat_1_6, pc_i440fx_1_6_machine_options); -static GlobalProperty pc_compatp_1_5[] = { - PC_COMPAT_1_5 -}; - static void pc_i440fx_1_5_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_1_5 + }; + pc_i440fx_1_6_machine_options(m); m->hw_version = "1.5.0"; - compat_props_add(m->compat_props, - pc_compatp_1_5, G_N_ELEMENTS(pc_compatp_1_5)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v1_5, "pc-i440fx-1.5", pc_compat_1_5, pc_i440fx_1_5_machine_options); -static GlobalProperty pc_compatp_1_4[] = { - PC_COMPAT_1_4 -}; - static void pc_i440fx_1_4_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_1_4 + }; + pc_i440fx_1_5_machine_options(m); m->hw_version = "1.4.0"; m->hot_add_cpu = NULL; - compat_props_add(m->compat_props, - pc_compatp_1_4, G_N_ELEMENTS(pc_compatp_1_4)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v1_4, "pc-i440fx-1.4", pc_compat_1_4, pc_i440fx_1_4_machine_options); -static GlobalProperty pc_compatp_1_3[] = { - PC_CPU_MODEL_IDS("1.3.0") - { - .driver = "usb-tablet", - .property = "usb_version", - .value = stringify(1), - },{ - .driver = "virtio-net-pci", - .property = "ctrl_mac_addr", - .value = "off", - },{ - .driver = "virtio-net-pci", - .property = "mq", - .value = "off", - }, { - .driver = "e1000", - .property = "autonegotiation", - .value = "off", - }, -}; - static void pc_i440fx_1_3_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("1.3.0") + { + .driver = "usb-tablet", + .property = "usb_version", + .value = stringify(1), + },{ + .driver = "virtio-net-pci", + .property = "ctrl_mac_addr", + .value = "off", + },{ + .driver = "virtio-net-pci", + .property = "mq", + .value = "off", + }, { + .driver = "e1000", + .property = "autonegotiation", + .value = "off", + }, + }; + pc_i440fx_1_4_machine_options(m); m->hw_version = "1.3.0"; - compat_props_add(m->compat_props, - pc_compatp_1_3, G_N_ELEMENTS(pc_compatp_1_3)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v1_3, "pc-1.3", pc_compat_1_3, pc_i440fx_1_3_machine_options); -static GlobalProperty pc_compatp_1_2[] = { - PC_CPU_MODEL_IDS("1.2.0") - { - .driver = "nec-usb-xhci", - .property = "msi", - .value = "off", - },{ - .driver = "nec-usb-xhci", - .property = "msix", - .value = "off", - },{ - .driver = "ivshmem", - .property = "use64", - .value = "0", - },{ - .driver = "qxl", - .property = "revision", - .value = stringify(3), - },{ - .driver = "qxl-vga", - .property = "revision", - .value = stringify(3), - },{ - .driver = "VGA", - .property = "mmio", - .value = "off", - }, -}; - static void pc_i440fx_1_2_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("1.2.0") + { + .driver = "nec-usb-xhci", + .property = "msi", + .value = "off", + },{ + .driver = "nec-usb-xhci", + .property = "msix", + .value = "off", + },{ + .driver = "ivshmem", + .property = "use64", + .value = "0", + },{ + .driver = "qxl", + .property = "revision", + .value = stringify(3), + },{ + .driver = "qxl-vga", + .property = "revision", + .value = stringify(3), + },{ + .driver = "VGA", + .property = "mmio", + .value = "off", + }, + }; + pc_i440fx_1_3_machine_options(m); m->hw_version = "1.2.0"; - compat_props_add(m->compat_props, - pc_compatp_1_2, G_N_ELEMENTS(pc_compatp_1_2)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v1_2, "pc-1.2", pc_compat_1_2, pc_i440fx_1_2_machine_options); -static GlobalProperty pc_compatp_1_1[] = { - PC_CPU_MODEL_IDS("1.1.0") - { - .driver = "virtio-scsi-pci", - .property = "hotplug", - .value = "off", - },{ - .driver = "virtio-scsi-pci", - .property = "param_change", - .value = "off", - },{ - .driver = "VGA", - .property = "vgamem_mb", - .value = stringify(8), - },{ - .driver = "vmware-svga", - .property = "vgamem_mb", - .value = stringify(8), - },{ - .driver = "qxl-vga", - .property = "vgamem_mb", - .value = stringify(8), - },{ - .driver = "qxl", - .property = "vgamem_mb", - .value = stringify(8), - },{ - .driver = "virtio-blk-pci", - .property = "config-wce", - .value = "off", - }, -}; - static void pc_i440fx_1_1_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("1.1.0") + { + .driver = "virtio-scsi-pci", + .property = "hotplug", + .value = "off", + },{ + .driver = "virtio-scsi-pci", + .property = "param_change", + .value = "off", + },{ + .driver = "VGA", + .property = "vgamem_mb", + .value = stringify(8), + },{ + .driver = "vmware-svga", + .property = "vgamem_mb", + .value = stringify(8), + },{ + .driver = "qxl-vga", + .property = "vgamem_mb", + .value = stringify(8), + },{ + .driver = "qxl", + .property = "vgamem_mb", + .value = stringify(8), + },{ + .driver = "virtio-blk-pci", + .property = "config-wce", + .value = "off", + }, + }; + pc_i440fx_1_2_machine_options(m); m->hw_version = "1.1.0"; - compat_props_add(m->compat_props, - pc_compatp_1_1, G_N_ELEMENTS(pc_compatp_1_1)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v1_1, "pc-1.1", pc_compat_1_2, pc_i440fx_1_1_machine_options); -static GlobalProperty pc_compatp_1_0[] = { - PC_CPU_MODEL_IDS("1.0") - { - .driver = TYPE_ISA_FDC, - .property = "check_media_rate", - .value = "off", - },{ - .driver = "virtio-balloon-pci", - .property = "class", - .value = stringify(PCI_CLASS_MEMORY_RAM), - },{ - .driver = "apic-common", - .property = "vapic", - .value = "off", - },{ - .driver = TYPE_USB_DEVICE, - .property = "full-path", - .value = "no", - }, -}; - static void pc_i440fx_1_0_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("1.0") + { + .driver = TYPE_ISA_FDC, + .property = "check_media_rate", + .value = "off", + },{ + .driver = "virtio-balloon-pci", + .property = "class", + .value = stringify(PCI_CLASS_MEMORY_RAM), + },{ + .driver = "apic-common", + .property = "vapic", + .value = "off", + },{ + .driver = TYPE_USB_DEVICE, + .property = "full-path", + .value = "no", + }, + }; + pc_i440fx_1_1_machine_options(m); m->hw_version = "1.0"; - compat_props_add(m->compat_props, - pc_compatp_1_0, G_N_ELEMENTS(pc_compatp_1_0)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v1_0, "pc-1.0", pc_compat_1_2, pc_i440fx_1_0_machine_options); -static GlobalProperty pc_compatp_0_15[] = { - PC_CPU_MODEL_IDS("0.15") -}; - static void pc_i440fx_0_15_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("0.15") + }; + pc_i440fx_1_0_machine_options(m); m->hw_version = "0.15"; m->deprecation_reason = "use a newer machine type instead"; - compat_props_add(m->compat_props, - pc_compatp_0_15, G_N_ELEMENTS(pc_compatp_0_15)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v0_15, "pc-0.15", pc_compat_1_2, pc_i440fx_0_15_machine_options); -static GlobalProperty pc_compatp_0_14[] = { - PC_CPU_MODEL_IDS("0.14") - { - .driver = "virtio-blk-pci", - .property = "event_idx", - .value = "off", - },{ - .driver = "virtio-serial-pci", - .property = "event_idx", - .value = "off", - },{ - .driver = "virtio-net-pci", - .property = "event_idx", - .value = "off", - },{ - .driver = "virtio-balloon-pci", - .property = "event_idx", - .value = "off", - },{ - .driver = "qxl", - .property = "revision", - .value = stringify(2), - },{ - .driver = "qxl-vga", - .property = "revision", - .value = stringify(2), - }, -}; - static void pc_i440fx_0_14_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("0.14") + { + .driver = "virtio-blk-pci", + .property = "event_idx", + .value = "off", + },{ + .driver = "virtio-serial-pci", + .property = "event_idx", + .value = "off", + },{ + .driver = "virtio-net-pci", + .property = "event_idx", + .value = "off", + },{ + .driver = "virtio-balloon-pci", + .property = "event_idx", + .value = "off", + },{ + .driver = "qxl", + .property = "revision", + .value = stringify(2), + },{ + .driver = "qxl-vga", + .property = "revision", + .value = stringify(2), + }, + }; + pc_i440fx_0_15_machine_options(m); m->hw_version = "0.14"; - compat_props_add(m->compat_props, - pc_compatp_0_14, G_N_ELEMENTS(pc_compatp_0_14)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v0_14, "pc-0.14", pc_compat_1_2, pc_i440fx_0_14_machine_options); -static GlobalProperty pc_compatp_0_13[] = { - PC_CPU_MODEL_IDS("0.13") - { - .driver = TYPE_PCI_DEVICE, - .property = "command_serr_enable", - .value = "off", - },{ - .driver = "AC97", - .property = "use_broken_id", - .value = stringify(1), - },{ - .driver = "virtio-9p-pci", - .property = "vectors", - .value = stringify(0), - },{ - .driver = "VGA", - .property = "rombar", - .value = stringify(0), - },{ - .driver = "vmware-svga", - .property = "rombar", - .value = stringify(0), - }, -}; - static void pc_i440fx_0_13_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("0.13") + { + .driver = TYPE_PCI_DEVICE, + .property = "command_serr_enable", + .value = "off", + },{ + .driver = "AC97", + .property = "use_broken_id", + .value = stringify(1), + },{ + .driver = "virtio-9p-pci", + .property = "vectors", + .value = stringify(0), + },{ + .driver = "VGA", + .property = "rombar", + .value = stringify(0), + },{ + .driver = "vmware-svga", + .property = "rombar", + .value = stringify(0), + }, + }; + pc_i440fx_0_14_machine_options(m); m->hw_version = "0.13"; - compat_props_add(m->compat_props, - pc_compatp_0_13, G_N_ELEMENTS(pc_compatp_0_13)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); pcmc->kvmclock_enabled = false; } DEFINE_I440FX_MACHINE(v0_13, "pc-0.13", pc_compat_0_13, pc_i440fx_0_13_machine_options); -static GlobalProperty pc_compat_0_12[] = { - PC_CPU_MODEL_IDS("0.12") - { - .driver = "virtio-serial-pci", - .property = "max_ports", - .value = stringify(1), - },{ - .driver = "virtio-serial-pci", - .property = "vectors", - .value = stringify(0), - },{ - .driver = "usb-mouse", - .property = "serial", - .value = "1", - },{ - .driver = "usb-tablet", - .property = "serial", - .value = "1", - },{ - .driver = "usb-kbd", - .property = "serial", - .value = "1", - }, -}; - static void pc_i440fx_0_12_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_CPU_MODEL_IDS("0.12") + { + .driver = "virtio-serial-pci", + .property = "max_ports", + .value = stringify(1), + },{ + .driver = "virtio-serial-pci", + .property = "vectors", + .value = stringify(0), + },{ + .driver = "usb-mouse", + .property = "serial", + .value = "1", + },{ + .driver = "usb-tablet", + .property = "serial", + .value = "1", + },{ + .driver = "usb-kbd", + .property = "serial", + .value = "1", + }, + }; + pc_i440fx_0_13_machine_options(m); m->hw_version = "0.12"; - compat_props_add(m->compat_props, - pc_compat_0_12, G_N_ELEMENTS(pc_compat_0_12)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_I440FX_MACHINE(v0_12, "pc-0.12", pc_compat_0_13, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 4ae6718b74..d84614546c 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -321,76 +321,71 @@ static void pc_q35_4_0_machine_options(MachineClass *m) DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL, pc_q35_4_0_machine_options); -static GlobalProperty pc_compat_3_1[] = { - PC_COMPAT_3_1 -}; - static void pc_q35_3_1_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_3_1 + }; + pc_q35_4_0_machine_options(m); m->default_kernel_irqchip_split = false; m->alias = NULL; - compat_props_add(m->compat_props, - pc_compat_3_1, G_N_ELEMENTS(pc_compat_3_1)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL, pc_q35_3_1_machine_options); -static GlobalProperty pc_compat_3_0[] = { - PC_COMPAT_3_0 -}; - static void pc_q35_3_0_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_3_0 + }; + pc_q35_3_1_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_3_0, G_N_ELEMENTS(pc_compat_3_0)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL, pc_q35_3_0_machine_options); -static GlobalProperty pc_compat_2_12[] = { - PC_COMPAT_2_12 -}; - static void pc_q35_2_12_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_12 + }; + pc_q35_3_0_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_12, G_N_ELEMENTS(pc_compat_2_12)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_12, "pc-q35-2.12", NULL, pc_q35_2_12_machine_options); -static GlobalProperty pc_compat_2_11[] = { - PC_COMPAT_2_11 -}; - static void pc_q35_2_11_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_11 + }; + pc_q35_2_12_machine_options(m); pcmc->default_nic_model = "e1000"; - compat_props_add(m->compat_props, - pc_compat_2_11, G_N_ELEMENTS(pc_compat_2_11)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL, pc_q35_2_11_machine_options); -static GlobalProperty pc_compat_2_10[] = { - PC_COMPAT_2_10 -}; - static void pc_q35_2_10_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_10 + }; + pc_q35_2_11_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_10, G_N_ELEMENTS(pc_compat_2_10)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; m->auto_enable_numa_with_memhp = false; } @@ -398,95 +393,89 @@ static void pc_q35_2_10_machine_options(MachineClass *m) DEFINE_Q35_MACHINE(v2_10, "pc-q35-2.10", NULL, pc_q35_2_10_machine_options); -static GlobalProperty pc_compat_2_9[] = { - PC_COMPAT_2_9 -}; - static void pc_q35_2_9_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_9 + }; + pc_q35_2_10_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_9, G_N_ELEMENTS(pc_compat_2_9)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_9, "pc-q35-2.9", NULL, pc_q35_2_9_machine_options); -static GlobalProperty pc_compat_2_8[] = { - PC_COMPAT_2_8 -}; - static void pc_q35_2_8_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_8 + }; + pc_q35_2_9_machine_options(m); - compat_props_add(m->compat_props, - pc_compat_2_8, G_N_ELEMENTS(pc_compat_2_8)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_8, "pc-q35-2.8", NULL, pc_q35_2_8_machine_options); -static GlobalProperty pc_compat_2_7[] = { - PC_COMPAT_2_7 -}; - static void pc_q35_2_7_machine_options(MachineClass *m) { + static GlobalProperty compat[] = { + PC_COMPAT_2_7 + }; + pc_q35_2_8_machine_options(m); m->max_cpus = 255; - compat_props_add(m->compat_props, - pc_compat_2_7, G_N_ELEMENTS(pc_compat_2_7)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_7, "pc-q35-2.7", NULL, pc_q35_2_7_machine_options); -static GlobalProperty pc_compat_2_6[] = { - PC_COMPAT_2_6 -}; - static void pc_q35_2_6_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_6 + }; + pc_q35_2_7_machine_options(m); pcmc->legacy_cpu_hotplug = true; pcmc->linuxboot_dma_enabled = false; - compat_props_add(m->compat_props, - pc_compat_2_6, G_N_ELEMENTS(pc_compat_2_6)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL, pc_q35_2_6_machine_options); -static GlobalProperty pc_compat_2_5[] = { - PC_COMPAT_2_5 -}; - static void pc_q35_2_5_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_5 + }; + pc_q35_2_6_machine_options(m); pcmc->save_tsc_khz = false; m->legacy_fw_cfg_order = 1; - compat_props_add(m->compat_props, - pc_compat_2_5, G_N_ELEMENTS(pc_compat_2_5)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_5, "pc-q35-2.5", NULL, pc_q35_2_5_machine_options); -static GlobalProperty pc_compat_2_4[] = { - PC_COMPAT_2_4 -}; - static void pc_q35_2_4_machine_options(MachineClass *m) { PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + static GlobalProperty compat[] = { + PC_COMPAT_2_4 + }; + pc_q35_2_5_machine_options(m); m->hw_version = "2.4.0"; pcmc->broken_reserved_end = true; - compat_props_add(m->compat_props, - pc_compat_2_4, G_N_ELEMENTS(pc_compat_2_4)); + compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL, diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f27aa5a09f..f3b8c18de3 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4021,15 +4021,14 @@ DEFINE_SPAPR_MACHINE(4_0, "4.0", true); /* * pseries-3.1 */ -static GlobalProperty spapr_compat_3_1[] = { - HW_COMPAT_3_1 -}; - static void spapr_machine_3_1_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_3_1 + }; + spapr_machine_4_0_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_3_1, G_N_ELEMENTS(spapr_compat_3_1)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0"); } @@ -4038,17 +4037,16 @@ DEFINE_SPAPR_MACHINE(3_1, "3.1", false); /* * pseries-3.0 */ -static GlobalProperty spapr_compat_3_0[] = { - HW_COMPAT_3_0 -}; static void spapr_machine_3_0_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_3_0 + }; spapr_machine_3_1_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_3_0, G_N_ELEMENTS(spapr_compat_3_0)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); smc->legacy_irq_allocation = true; smc->irq = &spapr_irq_xics_legacy; @@ -4059,27 +4057,25 @@ DEFINE_SPAPR_MACHINE(3_0, "3.0", false); /* * pseries-2.12 */ -static GlobalProperty spapr_compat_2_12[] = { - HW_COMPAT_2_12 - { - .driver = TYPE_POWERPC_CPU, - .property = "pre-3.0-migration", - .value = "on", - }, - { - .driver = TYPE_SPAPR_CPU_CORE, - .property = "pre-3.0-migration", - .value = "on", - }, -}; - static void spapr_machine_2_12_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_12 + { + .driver = TYPE_POWERPC_CPU, + .property = "pre-3.0-migration", + .value = "on", + }, + { + .driver = TYPE_SPAPR_CPU_CORE, + .property = "pre-3.0-migration", + .value = "on", + }, + }; spapr_machine_3_0_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_2_12, G_N_ELEMENTS(spapr_compat_2_12)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); /* 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 @@ -4106,18 +4102,17 @@ DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false); /* * pseries-2.11 */ -static GlobalProperty spapr_compat_2_11[] = { - HW_COMPAT_2_11 -}; static void spapr_machine_2_11_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_11 + }; spapr_machine_2_12_class_options(mc); smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON; - compat_props_add(mc->compat_props, - spapr_compat_2_11, G_N_ELEMENTS(spapr_compat_2_11)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_SPAPR_MACHINE(2_11, "2.11", false); @@ -4125,15 +4120,15 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false); /* * pseries-2.10 */ -static GlobalProperty spapr_compat_2_10[] = { - HW_COMPAT_2_10 -}; static void spapr_machine_2_10_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_10 + }; + spapr_machine_2_11_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_2_10, G_N_ELEMENTS(spapr_compat_2_10)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_SPAPR_MACHINE(2_10, "2.10", false); @@ -4141,22 +4136,21 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", false); /* * pseries-2.9 */ -static GlobalProperty spapr_compat_2_9[] = { - HW_COMPAT_2_9 - { - .driver = TYPE_POWERPC_CPU, - .property = "pre-2.10-migration", - .value = "on", - }, -}; static void spapr_machine_2_9_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_9 + { + .driver = TYPE_POWERPC_CPU, + .property = "pre-2.10-migration", + .value = "on", + }, + }; spapr_machine_2_10_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_2_9, G_N_ELEMENTS(spapr_compat_2_9)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); 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; @@ -4167,20 +4161,20 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false); /* * pseries-2.8 */ -static GlobalProperty spapr_compat_2_8[] = { - HW_COMPAT_2_8 - { - .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, - .property = "pcie-extended-configuration-space", - .value = "off", - }, -}; static void spapr_machine_2_8_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_8 + { + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, + .property = "pcie-extended-configuration-space", + .value = "off", + }, + }; + spapr_machine_2_9_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_2_8, G_N_ELEMENTS(spapr_compat_2_8)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); mc->numa_mem_align_shift = 23; } @@ -4189,29 +4183,6 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false); /* * pseries-2.7 */ -static GlobalProperty spapr_compat_2_7[] = { - HW_COMPAT_2_7 - { - .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, - .property = "mem_win_size", - .value = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE), - }, - { - .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, - .property = "mem64_win_size", - .value = "0", - }, - { - .driver = TYPE_POWERPC_CPU, - .property = "pre-2.8-migration", - .value = "on", - }, - { - .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, - .property = "pre-2.8-migration", - .value = "on", - }, -}; static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, uint64_t *buid, hwaddr *pio, @@ -4265,12 +4236,34 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, static void spapr_machine_2_7_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_7 + { + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, + .property = "mem_win_size", + .value = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE), + }, + { + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, + .property = "mem64_win_size", + .value = "0", + }, + { + .driver = TYPE_POWERPC_CPU, + .property = "pre-2.8-migration", + .value = "on", + }, + { + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, + .property = "pre-2.8-migration", + .value = "on", + }, + }; spapr_machine_2_8_class_options(mc); mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); mc->default_machine_opts = "modern-hotplug-events=off"; - compat_props_add(mc->compat_props, - spapr_compat_2_7, G_N_ELEMENTS(spapr_compat_2_7)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); smc->phb_placement = phb_placement_2_7; } @@ -4279,21 +4272,21 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false); /* * pseries-2.6 */ -static GlobalProperty spapr_compat_2_6[] = { - HW_COMPAT_2_6 - { - .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, - .property = "ddw", - .value = stringify(off), - }, -}; static void spapr_machine_2_6_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_6 + { + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, + .property = "ddw", + .value = stringify(off), + }, + }; + spapr_machine_2_7_class_options(mc); mc->has_hotpluggable_cpus = false; - compat_props_add(mc->compat_props, - spapr_compat_2_6, G_N_ELEMENTS(spapr_compat_2_6)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_SPAPR_MACHINE(2_6, "2.6", false); @@ -4301,23 +4294,22 @@ DEFINE_SPAPR_MACHINE(2_6, "2.6", false); /* * pseries-2.5 */ -static GlobalProperty spapr_compat_2_5[] = { - HW_COMPAT_2_5 - { - .driver = "spapr-vlan", - .property = "use-rx-buffer-pools", - .value = "off", - }, -}; static void spapr_machine_2_5_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_5 + { + .driver = "spapr-vlan", + .property = "use-rx-buffer-pools", + .value = "off", + }, + }; spapr_machine_2_6_class_options(mc); smc->use_ohci_by_default = true; - compat_props_add(mc->compat_props, - spapr_compat_2_5, G_N_ELEMENTS(spapr_compat_2_5)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_SPAPR_MACHINE(2_5, "2.5", false); @@ -4325,18 +4317,17 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false); /* * pseries-2.4 */ -static GlobalProperty spapr_compat_2_4[] = { - HW_COMPAT_2_4 -}; static void spapr_machine_2_4_class_options(MachineClass *mc) { sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_4 + }; spapr_machine_2_5_class_options(mc); smc->dr_lmb_enabled = false; - compat_props_add(mc->compat_props, - spapr_compat_2_4, G_N_ELEMENTS(spapr_compat_2_4)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_SPAPR_MACHINE(2_4, "2.4", false); @@ -4344,40 +4335,39 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false); /* * pseries-2.3 */ -static GlobalProperty spapr_compat_2_3[] = { - HW_COMPAT_2_3 - { - .driver = "spapr-pci-host-bridge", - .property = "dynamic-reconfiguration", - .value = "off", - }, -}; static void spapr_machine_2_3_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_3 + { + .driver = "spapr-pci-host-bridge", + .property = "dynamic-reconfiguration", + .value = "off", + }, + }; spapr_machine_2_4_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_2_3, G_N_ELEMENTS(spapr_compat_2_3)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_SPAPR_MACHINE(2_3, "2.3", false); /* * pseries-2.2 */ -static GlobalProperty spapr_compat_2_2[] = { - HW_COMPAT_2_2 - { - .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, - .property = "mem_win_size", - .value = "0x20000000", - }, -}; static void spapr_machine_2_2_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_2 + { + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, + .property = "mem_win_size", + .value = "0x20000000", + }, + }; + spapr_machine_2_3_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_2_2, G_N_ELEMENTS(spapr_compat_2_2)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); mc->default_machine_opts = "modern-hotplug-events=off,suppress-vmdesc=on"; } DEFINE_SPAPR_MACHINE(2_2, "2.2", false); @@ -4385,15 +4375,15 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false); /* * pseries-2.1 */ -static GlobalProperty spapr_compat_2_1[] = { - HW_COMPAT_2_1 -}; static void spapr_machine_2_1_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_1 + }; + spapr_machine_2_2_class_options(mc); - compat_props_add(mc->compat_props, - spapr_compat_2_1, G_N_ELEMENTS(spapr_compat_2_1)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } 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 f2faea585e..21f3325c5a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -651,111 +651,6 @@ bool css_migration_enabled(void) } \ type_init(ccw_machine_register_##suffix) -static GlobalProperty ccw_compat_3_1[] = { - HW_COMPAT_3_1 -}; - -static GlobalProperty ccw_compat_3_0[] = { - HW_COMPAT_3_0 -}; - -static GlobalProperty ccw_compat_2_12[] = { - HW_COMPAT_2_12 -}; - -static GlobalProperty ccw_compat_2_11[] = { - HW_COMPAT_2_11 - { - .driver = TYPE_SCLP_EVENT_FACILITY, - .property = "allow_all_mask_sizes", - .value = "off", - }, -}; - -static GlobalProperty ccw_compat_2_10[] = { - HW_COMPAT_2_10 -}; - -static GlobalProperty ccw_compat_2_9[] = { - HW_COMPAT_2_9 - { - .driver = TYPE_S390_STATTRIB, - .property = "migration-enabled", - .value = "off", - }, -}; - -static GlobalProperty ccw_compat_2_8[] = { - HW_COMPAT_2_8 - { - .driver = TYPE_S390_FLIC_COMMON, - .property = "adapter_routes_max_batch", - .value = "64", - }, -}; - -static GlobalProperty ccw_compat_2_7[] = { - HW_COMPAT_2_7 -}; - -static GlobalProperty ccw_compat_2_6[] = { - HW_COMPAT_2_6 - { - .driver = TYPE_S390_IPL, - .property = "iplbext_migration", - .value = "off", - }, { - .driver = TYPE_VIRTUAL_CSS_BRIDGE, - .property = "css_dev_path", - .value = "off", - }, -}; - -static GlobalProperty ccw_compat_2_5[] = { - HW_COMPAT_2_5 -}; - -static GlobalProperty ccw_compat_2_4[] = { - HW_COMPAT_2_4 - { - .driver = TYPE_S390_SKEYS, - .property = "migration-enabled", - .value = "off", - },{ - .driver = "virtio-blk-ccw", - .property = "max_revision", - .value = "0", - },{ - .driver = "virtio-balloon-ccw", - .property = "max_revision", - .value = "0", - },{ - .driver = "virtio-serial-ccw", - .property = "max_revision", - .value = "0", - },{ - .driver = "virtio-9p-ccw", - .property = "max_revision", - .value = "0", - },{ - .driver = "virtio-rng-ccw", - .property = "max_revision", - .value = "0", - },{ - .driver = "virtio-net-ccw", - .property = "max_revision", - .value = "0", - },{ - .driver = "virtio-scsi-ccw", - .property = "max_revision", - .value = "0", - },{ - .driver = "vhost-scsi-ccw", - .property = "max_revision", - .value = "0", - }, -}; - static void ccw_machine_4_0_instance_options(MachineState *machine) { } @@ -772,9 +667,12 @@ static void ccw_machine_3_1_instance_options(MachineState *machine) static void ccw_machine_3_1_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_3_1 + }; + ccw_machine_4_0_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_3_1, G_N_ELEMENTS(ccw_compat_3_1)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(3_1, "3.1", false); @@ -786,11 +684,13 @@ static void ccw_machine_3_0_instance_options(MachineState *machine) static void ccw_machine_3_0_class_options(MachineClass *mc) { S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_3_0 + }; s390mc->hpage_1m_allowed = false; ccw_machine_3_1_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_3_0, G_N_ELEMENTS(ccw_compat_3_0)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(3_0, "3.0", false); @@ -803,9 +703,12 @@ static void ccw_machine_2_12_instance_options(MachineState *machine) static void ccw_machine_2_12_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_12 + }; + ccw_machine_3_0_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_12, G_N_ELEMENTS(ccw_compat_2_12)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_12, "2.12", false); @@ -820,9 +723,17 @@ static void ccw_machine_2_11_instance_options(MachineState *machine) static void ccw_machine_2_11_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_11 + { + .driver = TYPE_SCLP_EVENT_FACILITY, + .property = "allow_all_mask_sizes", + .value = "off", + }, + }; + ccw_machine_2_12_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_11, G_N_ELEMENTS(ccw_compat_2_11)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_11, "2.11", false); @@ -833,9 +744,12 @@ static void ccw_machine_2_10_instance_options(MachineState *machine) static void ccw_machine_2_10_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_10 + }; + ccw_machine_2_11_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_10, G_N_ELEMENTS(ccw_compat_2_10)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_10, "2.10", false); @@ -852,10 +766,17 @@ static void ccw_machine_2_9_instance_options(MachineState *machine) static void ccw_machine_2_9_class_options(MachineClass *mc) { S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_9 + { + .driver = TYPE_S390_STATTRIB, + .property = "migration-enabled", + .value = "off", + }, + }; ccw_machine_2_10_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_9, G_N_ELEMENTS(ccw_compat_2_9)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); s390mc->css_migration_enabled = false; } DEFINE_CCW_MACHINE(2_9, "2.9", false); @@ -867,9 +788,17 @@ static void ccw_machine_2_8_instance_options(MachineState *machine) static void ccw_machine_2_8_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_8 + { + .driver = TYPE_S390_FLIC_COMMON, + .property = "adapter_routes_max_batch", + .value = "64", + }, + }; + ccw_machine_2_9_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_8, G_N_ELEMENTS(ccw_compat_2_8)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_8, "2.8", false); @@ -881,11 +810,13 @@ static void ccw_machine_2_7_instance_options(MachineState *machine) static void ccw_machine_2_7_class_options(MachineClass *mc) { S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_7 + }; s390mc->cpu_model_allowed = false; ccw_machine_2_8_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_7, G_N_ELEMENTS(ccw_compat_2_7)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_7, "2.7", false); @@ -897,11 +828,22 @@ static void ccw_machine_2_6_instance_options(MachineState *machine) static void ccw_machine_2_6_class_options(MachineClass *mc) { S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc); + static GlobalProperty compat[] = { + HW_COMPAT_2_6 + { + .driver = TYPE_S390_IPL, + .property = "iplbext_migration", + .value = "off", + }, { + .driver = TYPE_VIRTUAL_CSS_BRIDGE, + .property = "css_dev_path", + .value = "off", + }, + }; s390mc->ri_allowed = false; ccw_machine_2_7_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_6, G_N_ELEMENTS(ccw_compat_2_6)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_6, "2.6", false); @@ -912,9 +854,12 @@ static void ccw_machine_2_5_instance_options(MachineState *machine) static void ccw_machine_2_5_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_5 + }; + ccw_machine_2_6_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_5, G_N_ELEMENTS(ccw_compat_2_5)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_5, "2.5", false); @@ -925,9 +870,49 @@ static void ccw_machine_2_4_instance_options(MachineState *machine) static void ccw_machine_2_4_class_options(MachineClass *mc) { + static GlobalProperty compat[] = { + HW_COMPAT_2_4 + { + .driver = TYPE_S390_SKEYS, + .property = "migration-enabled", + .value = "off", + },{ + .driver = "virtio-blk-ccw", + .property = "max_revision", + .value = "0", + },{ + .driver = "virtio-balloon-ccw", + .property = "max_revision", + .value = "0", + },{ + .driver = "virtio-serial-ccw", + .property = "max_revision", + .value = "0", + },{ + .driver = "virtio-9p-ccw", + .property = "max_revision", + .value = "0", + },{ + .driver = "virtio-rng-ccw", + .property = "max_revision", + .value = "0", + },{ + .driver = "virtio-net-ccw", + .property = "max_revision", + .value = "0", + },{ + .driver = "virtio-scsi-ccw", + .property = "max_revision", + .value = "0", + },{ + .driver = "vhost-scsi-ccw", + .property = "max_revision", + .value = "0", + }, + }; + ccw_machine_2_5_class_options(mc); - compat_props_add(mc->compat_props, - ccw_compat_2_4, G_N_ELEMENTS(ccw_compat_2_4)); + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } DEFINE_CCW_MACHINE(2_4, "2.4", false); diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 4532aa8632..d51148b6b3 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -159,27 +159,26 @@ static int xen_init(MachineState *ms) return 0; } -static GlobalProperty xen_compat_props[] = { - { - .driver = "migration", - .property = "store-global-state", - .value = "off", - }, - { - .driver = "migration", - .property = "send-configuration", - .value = "off", - }, - { - .driver = "migration", - .property = "send-section-footer", - .value = "off", - } -}; - static void xen_accel_class_init(ObjectClass *oc, void *data) { AccelClass *ac = ACCEL_CLASS(oc); + static GlobalProperty compat[] = { + { + .driver = "migration", + .property = "store-global-state", + .value = "off", + }, + { + .driver = "migration", + .property = "send-configuration", + .value = "off", + }, + { + .driver = "migration", + .property = "send-section-footer", + .value = "off", + } + }; ac->name = "Xen"; ac->init_machine = xen_init; @@ -187,8 +186,7 @@ static void xen_accel_class_init(ObjectClass *oc, void *data) ac->allowed = &xen_allowed; ac->compat_props = g_ptr_array_new(); - compat_props_add(ac->compat_props, - xen_compat_props, G_N_ELEMENTS(xen_compat_props)); + compat_props_add(ac->compat_props, compat, G_N_ELEMENTS(compat)); } #define TYPE_XEN_ACCEL ACCEL_CLASS_NAME("xen") |