summaryrefslogtreecommitdiffstats
path: root/hw/ppc
diff options
context:
space:
mode:
authorMarc-André Lureau2018-12-01 20:44:11 +0100
committerMarc-André Lureau2019-01-07 13:18:41 +0100
commitb66bbee39f6deb28f0645760c536cbf2189a0687 (patch)
treedd227120080b44e0a4dbdcb78c296e48de7b11a9 /hw/ppc
parentmachines: replace COMPAT define with a static array (diff)
downloadqemu-b66bbee39f6deb28f0645760c536cbf2189a0687.tar.gz
qemu-b66bbee39f6deb28f0645760c536cbf2189a0687.tar.xz
qemu-b66bbee39f6deb28f0645760c536cbf2189a0687.zip
hw: apply machine compat properties without touching globals
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.lureau@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index f724a8d57a..f27aa5a09f 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4028,7 +4028,8 @@ static GlobalProperty spapr_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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_3_1, G_N_ELEMENTS(spapr_compat_3_1));
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0");
}
@@ -4046,7 +4047,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_3_0, G_N_ELEMENTS(spapr_compat_3_0));
smc->legacy_irq_allocation = true;
smc->irq = &spapr_irq_xics_legacy;
@@ -4076,7 +4078,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_12, G_N_ELEMENTS(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
@@ -4113,7 +4116,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_11, G_N_ELEMENTS(spapr_compat_2_11));
}
DEFINE_SPAPR_MACHINE(2_11, "2.11", false);
@@ -4128,7 +4132,8 @@ static GlobalProperty spapr_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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_10, G_N_ELEMENTS(spapr_compat_2_10));
}
DEFINE_SPAPR_MACHINE(2_10, "2.10", false);
@@ -4150,7 +4155,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_9, G_N_ELEMENTS(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;
@@ -4173,7 +4179,8 @@ static GlobalProperty spapr_compat_2_8[] = {
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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_8, G_N_ELEMENTS(spapr_compat_2_8));
mc->numa_mem_align_shift = 23;
}
@@ -4262,7 +4269,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_7, G_N_ELEMENTS(spapr_compat_2_7));
smc->phb_placement = phb_placement_2_7;
}
@@ -4284,7 +4292,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_6, G_N_ELEMENTS(spapr_compat_2_6));
}
DEFINE_SPAPR_MACHINE(2_6, "2.6", false);
@@ -4307,7 +4316,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_5, G_N_ELEMENTS(spapr_compat_2_5));
}
DEFINE_SPAPR_MACHINE(2_5, "2.5", false);
@@ -4325,7 +4335,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_4, G_N_ELEMENTS(spapr_compat_2_4));
}
DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
@@ -4345,7 +4356,8 @@ static GlobalProperty spapr_compat_2_3[] = {
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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_3, G_N_ELEMENTS(spapr_compat_2_3));
}
DEFINE_SPAPR_MACHINE(2_3, "2.3", false);
@@ -4364,7 +4376,8 @@ static GlobalProperty spapr_compat_2_2[] = {
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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_2, G_N_ELEMENTS(spapr_compat_2_2));
mc->default_machine_opts = "modern-hotplug-events=off,suppress-vmdesc=on";
}
DEFINE_SPAPR_MACHINE(2_2, "2.2", false);
@@ -4379,7 +4392,8 @@ static GlobalProperty spapr_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);
+ compat_props_add(mc->compat_props,
+ spapr_compat_2_1, G_N_ELEMENTS(spapr_compat_2_1));
}
DEFINE_SPAPR_MACHINE(2_1, "2.1", false);