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 /hw/s390x | |
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>
Diffstat (limited to 'hw/s390x')
-rw-r--r-- | hw/s390x/s390-virtio-ccw.c | 239 |
1 files changed, 112 insertions, 127 deletions
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); |