diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-12-01 23:44:11 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2019-01-07 16:18:41 +0400 |
commit | b66bbee39f6deb28f0645760c536cbf2189a0687 (patch) | |
tree | dd227120080b44e0a4dbdcb78c296e48de7b11a9 /hw/s390x | |
parent | fa386d989d0bec0abdcd1a883853071928adcced (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/s390x')
-rw-r--r-- | hw/s390x/s390-virtio-ccw.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 882a9796cf..f2faea585e 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -773,7 +773,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_3_1, G_N_ELEMENTS(ccw_compat_3_1)); } DEFINE_CCW_MACHINE(3_1, "3.1", false); @@ -788,7 +789,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_3_0, G_N_ELEMENTS(ccw_compat_3_0)); } DEFINE_CCW_MACHINE(3_0, "3.0", false); @@ -802,7 +804,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_12, G_N_ELEMENTS(ccw_compat_2_12)); } DEFINE_CCW_MACHINE(2_12, "2.12", false); @@ -818,7 +821,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_11, G_N_ELEMENTS(ccw_compat_2_11)); } DEFINE_CCW_MACHINE(2_11, "2.11", false); @@ -830,7 +834,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_10, G_N_ELEMENTS(ccw_compat_2_10)); } DEFINE_CCW_MACHINE(2_10, "2.10", false); @@ -849,7 +854,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_9, G_N_ELEMENTS(ccw_compat_2_9)); s390mc->css_migration_enabled = false; } DEFINE_CCW_MACHINE(2_9, "2.9", false); @@ -862,7 +868,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_8, G_N_ELEMENTS(ccw_compat_2_8)); } DEFINE_CCW_MACHINE(2_8, "2.8", false); @@ -877,7 +884,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_7, G_N_ELEMENTS(ccw_compat_2_7)); } DEFINE_CCW_MACHINE(2_7, "2.7", false); @@ -892,7 +900,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_6, G_N_ELEMENTS(ccw_compat_2_6)); } DEFINE_CCW_MACHINE(2_6, "2.6", false); @@ -904,7 +913,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_5, G_N_ELEMENTS(ccw_compat_2_5)); } DEFINE_CCW_MACHINE(2_5, "2.5", false); @@ -916,7 +926,8 @@ 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); + compat_props_add(mc->compat_props, + ccw_compat_2_4, G_N_ELEMENTS(ccw_compat_2_4)); } DEFINE_CCW_MACHINE(2_4, "2.4", false); |