提交 fa386d98 编写于 作者: M Marc-André Lureau

machines: replace COMPAT define with a static array

Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
Reviewed-by: NCornelia Huck <cohuck@redhat.com>
Acked-by: NEduardo Habkost <ehabkost@redhat.com>
上级 ea9ce893
......@@ -1872,84 +1872,91 @@ static void virt_machine_4_0_options(MachineClass *mc)
}
DEFINE_VIRT_MACHINE_AS_LATEST(4, 0)
#define VIRT_COMPAT_3_1 \
static GlobalProperty virt_compat_3_1[] = {
HW_COMPAT_3_1
};
static void virt_machine_3_1_options(MachineClass *mc)
{
virt_machine_4_0_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_3_1);
SET_MACHINE_COMPAT(mc, virt_compat_3_1);
}
DEFINE_VIRT_MACHINE(3, 1)
#define VIRT_COMPAT_3_0 \
static GlobalProperty virt_compat_3_0[] = {
HW_COMPAT_3_0
};
static void virt_machine_3_0_options(MachineClass *mc)
{
virt_machine_3_1_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_3_0);
SET_MACHINE_COMPAT(mc, virt_compat_3_0);
}
DEFINE_VIRT_MACHINE(3, 0)
#define VIRT_COMPAT_2_12 \
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));
virt_machine_3_0_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_12);
SET_MACHINE_COMPAT(mc, virt_compat_2_12);
vmc->no_highmem_ecam = true;
mc->max_cpus = 255;
}
DEFINE_VIRT_MACHINE(2, 12)
#define VIRT_COMPAT_2_11 \
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));
virt_machine_2_12_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_11);
SET_MACHINE_COMPAT(mc, virt_compat_2_11);
vmc->smbios_old_sys_ver = true;
}
DEFINE_VIRT_MACHINE(2, 11)
#define VIRT_COMPAT_2_10 \
static GlobalProperty virt_compat_2_10[] = {
HW_COMPAT_2_10
};
static void virt_machine_2_10_options(MachineClass *mc)
{
virt_machine_2_11_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_10);
SET_MACHINE_COMPAT(mc, virt_compat_2_10);
/* before 2.11 we never faulted accesses to bad addresses */
mc->ignore_memory_transaction_failures = true;
}
DEFINE_VIRT_MACHINE(2, 10)
#define VIRT_COMPAT_2_9 \
static GlobalProperty virt_compat_2_9[] = {
HW_COMPAT_2_9
};
static void virt_machine_2_9_options(MachineClass *mc)
{
virt_machine_2_10_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_9);
SET_MACHINE_COMPAT(mc, virt_compat_2_9);
}
DEFINE_VIRT_MACHINE(2, 9)
#define VIRT_COMPAT_2_8 \
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));
virt_machine_2_9_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_8);
SET_MACHINE_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.
*/
......@@ -1957,15 +1964,16 @@ static void virt_machine_2_8_options(MachineClass *mc)
}
DEFINE_VIRT_MACHINE(2, 8)
#define VIRT_COMPAT_2_7 \
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));
virt_machine_2_8_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_7);
SET_MACHINE_COMPAT(mc, virt_compat_2_7);
/* ITS was introduced with 2.8 */
vmc->no_its = true;
/* Stick with 1K pages for migration compatibility */
......@@ -1973,15 +1981,16 @@ static void virt_machine_2_7_options(MachineClass *mc)
}
DEFINE_VIRT_MACHINE(2, 7)
#define VIRT_COMPAT_2_6 \
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));
virt_machine_2_7_options(mc);
SET_MACHINE_COMPAT(mc, VIRT_COMPAT_2_6);
SET_MACHINE_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;
......
此差异已折叠。
......@@ -321,51 +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)
{
pc_q35_4_0_machine_options(m);
m->default_kernel_irqchip_split = false;
m->alias = NULL;
SET_MACHINE_COMPAT(m, PC_COMPAT_3_1);
SET_MACHINE_COMPAT(m, pc_compat_3_1);
}
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)
{
pc_q35_3_1_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_3_0);
SET_MACHINE_COMPAT(m, pc_compat_3_0);
}
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)
{
pc_q35_3_0_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_2_12);
SET_MACHINE_COMPAT(m, pc_compat_2_12);
}
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);
pc_q35_2_12_machine_options(m);
pcmc->default_nic_model = "e1000";
SET_MACHINE_COMPAT(m, PC_COMPAT_2_11);
SET_MACHINE_COMPAT(m, pc_compat_2_11);
}
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)
{
pc_q35_2_11_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_2_10);
SET_MACHINE_COMPAT(m, pc_compat_2_10);
m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
m->auto_enable_numa_with_memhp = false;
}
......@@ -373,65 +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)
{
pc_q35_2_10_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_2_9);
SET_MACHINE_COMPAT(m, pc_compat_2_9);
}
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)
{
pc_q35_2_9_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_2_8);
SET_MACHINE_COMPAT(m, pc_compat_2_8);
}
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)
{
pc_q35_2_8_machine_options(m);
m->max_cpus = 255;
SET_MACHINE_COMPAT(m, PC_COMPAT_2_7);
SET_MACHINE_COMPAT(m, pc_compat_2_7);
}
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);
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_MACHINE_COMPAT(m, pc_compat_2_6);
}
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);
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_MACHINE_COMPAT(m, pc_compat_2_5);
}
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);
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_MACHINE_COMPAT(m, pc_compat_2_4);
}
DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL,
......
......@@ -4021,13 +4021,14 @@ DEFINE_SPAPR_MACHINE(4_0, "4.0", true);
/*
* pseries-3.1
*/
#define SPAPR_COMPAT_3_1 \
static GlobalProperty spapr_compat_3_1[] = {
HW_COMPAT_3_1
};
static void spapr_machine_3_1_class_options(MachineClass *mc)
{
spapr_machine_4_0_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_1);
SET_MACHINE_COMPAT(mc, spapr_compat_3_1);
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0");
}
......@@ -4036,15 +4037,16 @@ DEFINE_SPAPR_MACHINE(3_1, "3.1", false);
/*
* pseries-3.0
*/
#define SPAPR_COMPAT_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);
spapr_machine_3_1_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_3_0);
SET_MACHINE_COMPAT(mc, spapr_compat_3_0);
smc->legacy_irq_allocation = true;
smc->irq = &spapr_irq_xics_legacy;
......@@ -4055,25 +4057,26 @@ DEFINE_SPAPR_MACHINE(3_0, "3.0", false);
/*
* pseries-2.12
*/
#define 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 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);
spapr_machine_3_0_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_12);
SET_MACHINE_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
......@@ -4100,8 +4103,9 @@ DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false);
/*
* pseries-2.11
*/
#define SPAPR_COMPAT_2_11 \
static GlobalProperty spapr_compat_2_11[] = {
HW_COMPAT_2_11
};
static void spapr_machine_2_11_class_options(MachineClass *mc)
{
......@@ -4109,7 +4113,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_MACHINE_COMPAT(mc, spapr_compat_2_11);
}
DEFINE_SPAPR_MACHINE(2_11, "2.11", false);
......@@ -4117,13 +4121,14 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false);
/*
* pseries-2.10
*/
#define SPAPR_COMPAT_2_10 \
static GlobalProperty spapr_compat_2_10[] = {
HW_COMPAT_2_10
};
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_MACHINE_COMPAT(mc, spapr_compat_2_10);
}
DEFINE_SPAPR_MACHINE(2_10, "2.10", false);
......@@ -4131,20 +4136,21 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", false);
/*
* pseries-2.9
*/
#define SPAPR_COMPAT_2_9 \
HW_COMPAT_2_9 \
{ \
.driver = TYPE_POWERPC_CPU, \
.property = "pre-2.10-migration", \
.value = "on", \
}, \
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);
spapr_machine_2_10_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_9);
SET_MACHINE_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;
......@@ -4155,18 +4161,19 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false);
/*
* pseries-2.8
*/
#define SPAPR_COMPAT_2_8 \
HW_COMPAT_2_8 \
{ \
.driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \
.property = "pcie-extended-configuration-space", \
.value = "off", \
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)
{
spapr_machine_2_9_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_8);
SET_MACHINE_COMPAT(mc, spapr_compat_2_8);
mc->numa_mem_align_shift = 23;
}
......@@ -4175,28 +4182,29 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false);
/*
* pseries-2.7
*/
#define 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 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,
......@@ -4254,7 +4262,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");
mc->default_machine_opts = "modern-hotplug-events=off";
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7);
SET_MACHINE_COMPAT(mc, spapr_compat_2_7);
smc->phb_placement = phb_placement_2_7;
}
......@@ -4263,19 +4271,20 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false);
/*
* pseries-2.6
*/
#define SPAPR_COMPAT_2_6 \
HW_COMPAT_2_6 \
{ \
.driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\
.property = "ddw",\
.value = stringify(off),\
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)
{
spapr_machine_2_7_class_options(mc);
mc->has_hotpluggable_cpus = false;
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_6);
SET_MACHINE_COMPAT(mc, spapr_compat_2_6);
}
DEFINE_SPAPR_MACHINE(2_6, "2.6", false);
......@@ -4283,13 +4292,14 @@ DEFINE_SPAPR_MACHINE(2_6, "2.6", false);
/*
* pseries-2.5
*/
#define SPAPR_COMPAT_2_5 \
HW_COMPAT_2_5 \
{ \
.driver = "spapr-vlan", \
.property = "use-rx-buffer-pools", \
.value = "off", \
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)
{
......@@ -4297,7 +4307,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_MACHINE_COMPAT(mc, spapr_compat_2_5);
}
DEFINE_SPAPR_MACHINE(2_5, "2.5", false);
......@@ -4305,8 +4315,9 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false);
/*
* pseries-2.4
*/
#define SPAPR_COMPAT_2_4 \
HW_COMPAT_2_4
static GlobalProperty spapr_compat_2_4[] = {
HW_COMPAT_2_4
};
static void spapr_machine_2_4_class_options(MachineClass *mc)
{
......@@ -4314,7 +4325,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_MACHINE_COMPAT(mc, spapr_compat_2_4);
}
DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
......@@ -4322,37 +4333,38 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
/*
* pseries-2.3
*/
#define SPAPR_COMPAT_2_3 \
HW_COMPAT_2_3 \
{\
.driver = "spapr-pci-host-bridge",\
.property = "dynamic-reconfiguration",\
.value = "off",\
},
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)
{
spapr_machine_2_4_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_3);
SET_MACHINE_COMPAT(mc, spapr_compat_2_3);
}
DEFINE_SPAPR_MACHINE(2_3, "2.3", false);
/*
* pseries-2.2
*/
#define SPAPR_COMPAT_2_2 \
HW_COMPAT_2_2 \
{\
.driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\
.property = "mem_win_size",\
.value = "0x20000000",\
},
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)
{
spapr_machine_2_3_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_2);
SET_MACHINE_COMPAT(mc, spapr_compat_2_2);
mc->default_machine_opts = "modern-hotplug-events=off,suppress-vmdesc=on";
}
DEFINE_SPAPR_MACHINE(2_2, "2.2", false);
......@@ -4360,13 +4372,14 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false);
/*
* pseries-2.1
*/
#define SPAPR_COMPAT_2_1 \
HW_COMPAT_2_1
static GlobalProperty spapr_compat_2_1[] = {
HW_COMPAT_2_1
};
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_MACHINE_COMPAT(mc, spapr_compat_2_1);
}
DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
......
......@@ -651,99 +651,110 @@ bool css_migration_enabled(void)
} \
type_init(ccw_machine_register_##suffix)
#define CCW_COMPAT_3_1 \
HW_COMPAT_3_1
#define CCW_COMPAT_3_0 \
HW_COMPAT_3_0
#define CCW_COMPAT_2_12 \
HW_COMPAT_2_12
#define CCW_COMPAT_2_11 \
HW_COMPAT_2_11 \
{\
.driver = TYPE_SCLP_EVENT_FACILITY,\
.property = "allow_all_mask_sizes",\
.value = "off",\
},
#define CCW_COMPAT_2_10 \
HW_COMPAT_2_10
#define CCW_COMPAT_2_9 \
HW_COMPAT_2_9 \
{\
.driver = TYPE_S390_STATTRIB,\
.property = "migration-enabled",\
.value = "off",\
},
#define CCW_COMPAT_2_8 \
HW_COMPAT_2_8 \
{\
.driver = TYPE_S390_FLIC_COMMON,\
.property = "adapter_routes_max_batch",\
.value = "64",\
},
#define CCW_COMPAT_2_7 \
HW_COMPAT_2_7
#define 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",\
},
#define CCW_COMPAT_2_5 \
HW_COMPAT_2_5
#define 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 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)
{
......@@ -762,7 +773,7 @@ static void ccw_machine_3_1_instance_options(MachineState *machine)
static void ccw_machine_3_1_class_options(MachineClass *mc)
{
ccw_machine_4_0_class_options(mc);
SET_MACHINE_COMPAT(mc, CCW_COMPAT_3_1);
SET_MACHINE_COMPAT(mc, ccw_compat_3_1);
}
DEFINE_CCW_MACHINE(3_1, "3.1", false);
......@@ -777,7 +788,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_MACHINE_COMPAT(mc, ccw_compat_3_0);
}
DEFINE_CCW_MACHINE(3_0, "3.0", false);
......@@ -791,7 +802,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_MACHINE_COMPAT(mc, ccw_compat_2_12);
}
DEFINE_CCW_MACHINE(2_12, "2.12", false);
......@@ -807,7 +818,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_MACHINE_COMPAT(mc, ccw_compat_2_11);
}
DEFINE_CCW_MACHINE(2_11, "2.11", false);
......@@ -819,7 +830,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_MACHINE_COMPAT(mc, ccw_compat_2_10);
}
DEFINE_CCW_MACHINE(2_10, "2.10", false);
......@@ -838,7 +849,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_MACHINE_COMPAT(mc, ccw_compat_2_9);
s390mc->css_migration_enabled = false;
}
DEFINE_CCW_MACHINE(2_9, "2.9", false);
......@@ -851,7 +862,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_MACHINE_COMPAT(mc, ccw_compat_2_8);
}
DEFINE_CCW_MACHINE(2_8, "2.8", false);
......@@ -866,7 +877,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_MACHINE_COMPAT(mc, ccw_compat_2_7);
}
DEFINE_CCW_MACHINE(2_7, "2.7", false);
......@@ -881,7 +892,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_MACHINE_COMPAT(mc, ccw_compat_2_6);
}
DEFINE_CCW_MACHINE(2_6, "2.6", false);
......@@ -893,7 +904,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_MACHINE_COMPAT(mc, ccw_compat_2_5);
}
DEFINE_CCW_MACHINE(2_5, "2.5", false);
......@@ -905,7 +916,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_MACHINE_COMPAT(mc, ccw_compat_2_4);
}
DEFINE_CCW_MACHINE(2_4, "2.4", false);
......
......@@ -289,18 +289,14 @@ struct MachineState {
} \
type_init(machine_initfn##_register_types)
#define SET_MACHINE_COMPAT(m, COMPAT) \
#define SET_MACHINE_COMPAT(m, compat) \
do { \
int i; \
static GlobalProperty props[] = { \
COMPAT \
{ /* end of list */ } \
}; \
if (!m->compat_props) { \
m->compat_props = g_array_new(false, false, sizeof(void *)); \
} \
for (i = 0; props[i].driver != NULL; i++) { \
GlobalProperty *prop = &props[i]; \
for (i = 0; i < G_N_ELEMENTS(compat); i++) { \
GlobalProperty *prop = &compat[i]; \
g_array_append_val(m->compat_props, prop); \
} \
} while (0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册