aboutsummaryrefslogtreecommitdiff
path: root/hw/arm
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-12-01 23:44:11 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-07 16:18:41 +0400
commitb66bbee39f6deb28f0645760c536cbf2189a0687 (patch)
treedd227120080b44e0a4dbdcb78c296e48de7b11a9 /hw/arm
parentfa386d989d0bec0abdcd1a883853071928adcced (diff)
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/arm')
-rw-r--r--hw/arm/virt.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 6ecec1cb05..275ef8bc02 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1879,7 +1879,8 @@ static GlobalProperty virt_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);
+ compat_props_add(mc->compat_props,
+ virt_compat_3_1, G_N_ELEMENTS(virt_compat_3_1));
}
DEFINE_VIRT_MACHINE(3, 1)
@@ -1890,7 +1891,8 @@ static GlobalProperty virt_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);
+ compat_props_add(mc->compat_props,
+ virt_compat_3_0, G_N_ELEMENTS(virt_compat_3_0));
}
DEFINE_VIRT_MACHINE(3, 0)
@@ -1903,7 +1905,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ virt_compat_2_12, G_N_ELEMENTS(virt_compat_2_12));
vmc->no_highmem_ecam = true;
mc->max_cpus = 255;
}
@@ -1918,7 +1921,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ virt_compat_2_11, G_N_ELEMENTS(virt_compat_2_11));
vmc->smbios_old_sys_ver = true;
}
DEFINE_VIRT_MACHINE(2, 11)
@@ -1930,7 +1934,8 @@ static GlobalProperty virt_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);
+ compat_props_add(mc->compat_props,
+ virt_compat_2_10, G_N_ELEMENTS(virt_compat_2_10));
/* before 2.11 we never faulted accesses to bad addresses */
mc->ignore_memory_transaction_failures = true;
}
@@ -1943,7 +1948,8 @@ static GlobalProperty virt_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);
+ compat_props_add(mc->compat_props,
+ virt_compat_2_9, G_N_ELEMENTS(virt_compat_2_9));
}
DEFINE_VIRT_MACHINE(2, 9)
@@ -1956,7 +1962,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);
+ compat_props_add(mc->compat_props,
+ virt_compat_2_8, G_N_ELEMENTS(virt_compat_2_8));
/* For 2.8 and earlier we falsely claimed in the DT that
* our timers were edge-triggered, not level-triggered.
*/
@@ -1973,7 +1980,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ virt_compat_2_7, G_N_ELEMENTS(virt_compat_2_7));
/* ITS was introduced with 2.8 */
vmc->no_its = true;
/* Stick with 1K pages for migration compatibility */
@@ -1990,7 +1998,8 @@ 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);
+ compat_props_add(mc->compat_props,
+ virt_compat_2_6, G_N_ELEMENTS(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;