compat machines for 10.0
cover compat machines for 10.0
It's that time of the year^Wrelease cycle again, so here are the machine types for the next release. I'm also including the _AS_LATEST() patch that had apparently fallen through the cracks.
Cornelia Huck (1):
hw: add compat machines for 10.0
Daniel P. Berrangé (1):
hw/i386: define _AS_LATEST() macros for machine types
hw/arm/virt.c | 9 ++++++++- hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 20 ++++++++++++++------ hw/i386/pc_q35.c | 20 +++++++++++++++----- hw/m68k/virt.c | 9 ++++++++- hw/ppc/spapr.c | 15 +++++++++++++-- hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- include/hw/boards.h | 3 +++ include/hw/i386/pc.h | 7 ++++++- 10 files changed, 86 insertions(+), 17 deletions(-)
Signature · 1 line
2.47.0
PATCH 1/2 hw/i386: define _AS_LATEST() macros for machine types
From: Daniel P. Berrangé <[email protected]>
Follow the other architecture targets by adding extra macros for defining a versioned machine type as the latest. This reduces the size of the changes when introducing new machine types at the start of each release cycle.
Message-ID: <[email protected]>
--- hw/i386/pc_piix.c | 11 +++++------ hw/i386/pc_q35.c | 11 ++++++----- include/hw/i386/pc.h | 4 +++- 3 files changed, 14 insertions(+), 12 deletions(-)
hw/i386/pc_piix.c +5 -6
@@ -446,7 +446,10 @@ static void pc_i440fx_init(MachineState *machine) }#define DEFINE_I440FX_MACHINE (major, minor) \ - DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, major, minor); + DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, false, NULL, major, minor); + +#define DEFINE_I440FX_MACHINE_AS_LATEST (major, minor) \ + DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, true, "pc", major, minor);static void pc_i440fx_machine_options (MachineClass *m) {
@@ -477,17 +480,13 @@ static void pc_i440fx_machine_options(MachineClass *m)static void pc_i440fx_machine_9_2_options (MachineClass *m) {pc_i440fx_machine_options (m); - m->alias ="pc" ; - m->is_default = true; } -DEFINE_I440FX_MACHINE (9 ,2 ); +DEFINE_I440FX_MACHINE_AS_LATEST (9 ,2 );static void pc_i440fx_machine_9_1_options (MachineClass *m) {pc_i440fx_machine_9_2_options (m); - m->alias =NULL ; - m->is_default = false;compat_props_add (m->compat_props, hw_compat_9_1, hw_compat_9_1_len);compat_props_add (m->compat_props, pc_compat_9_1, pc_compat_9_1_len); }
hw/i386/pc_q35.c +6 -5
@@ -327,10 +327,13 @@ static void pc_q35_init(MachineState *machine) }#define DEFINE_Q35_MACHINE (major, minor) \ - DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, major, minor); + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, NULL, major, minor); + +#define DEFINE_Q35_MACHINE_AS_LATEST (major, minor) \ + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, "q35", major, minor);#define DEFINE_Q35_MACHINE_BUGFIX (major, minor, micro) \ - DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, major, minor, micro); + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, false, NULL, major, minor, micro);static void pc_q35_machine_options (MachineClass *m) {
@@ -359,15 +362,13 @@ static void pc_q35_machine_options(MachineClass *m)static void pc_q35_machine_9_2_options (MachineClass *m) {pc_q35_machine_options (m); - m->alias ="q35" ; } -DEFINE_Q35_MACHINE (9 ,2 ); +DEFINE_Q35_MACHINE_AS_LATEST (9 ,2 );static void pc_q35_machine_9_1_options (MachineClass *m) {pc_q35_machine_9_2_options (m); - m->alias =NULL ;compat_props_add (m->compat_props, hw_compat_9_1, hw_compat_9_1_len);compat_props_add (m->compat_props, pc_compat_9_1, pc_compat_9_1_len); }
include/hw/i386/pc.h +3 -1
@@ -320,7 +320,7 @@ extern const size_t pc_compat_2_3_len; } \ type_init(pc_machine_init_##suffix) -#define DEFINE_PC_VER_MACHINE (namesym, namestr, initfn, ...) \ +#define DEFINE_PC_VER_MACHINE (namesym, namestr, initfn, isdefault, malias, ...) \ static void MACHINE_VER_SYM(init, namesym, __VA_ARGS__)( \ MachineState *machine) \ { \
@@ -334,6 +334,8 @@ extern const size_t pc_compat_2_3_len;MACHINE_VER_SYM (options, namesym, __VA_ARGS__)(mc); \ mc->init =MACHINE_VER_SYM (init, namesym, __VA_ARGS__); \MACHINE_VER_DEPRECATION (__VA_ARGS__); \ + mc->is_default = isdefault; \ + mc->alias = malias; \ } \static const TypeInfo MACHINE_VER_SYM (info ,namesym ,__VA_ARGS__ ) = \ { \
Signature · 1 line
2.47.0
PATCH 2/2 hw: add compat machines for 10.0
In reply to Cornelia HuckAdd 10.0 machine types for arm/i440fx/m68k/q35/s390x/spapr.
--- hw/arm/virt.c | 9 ++++++++- hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 13 +++++++++++-- hw/i386/pc_q35.c | 13 +++++++++++-- hw/m68k/virt.c | 9 ++++++++- hw/ppc/spapr.c | 15 +++++++++++++-- hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- include/hw/boards.h | 3 +++ include/hw/i386/pc.h | 3 +++ 10 files changed, 76 insertions(+), 9 deletions(-)
hw/arm/virt.c +8 -1
@@ -3353,10 +3353,17 @@ static void machvirt_machine_init(void) }type_init (machvirt_machine_init); +static void virt_machine_10_0_options (MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(10, 0) +static void virt_machine_9_2_options (MachineClass *mc) { +virt_machine_10_0_options (mc); +compat_props_add (mc->compat_props, hw_compat_9_2, hw_compat_9_2_len); } -DEFINE_VIRT_MACHINE_AS_LATEST(9, 2) +DEFINE_VIRT_MACHINE(9, 2)static void virt_machine_9_1_options (MachineClass *mc) {
hw/core/machine.c +3 -0
@@ -36,6 +36,9 @@#include "hw/virtio/virtio-iommu.h" #include "audio/audio.h" +GlobalProperty hw_compat_9_2[] = {}; +const size_t hw_compat_9_2_len =G_N_ELEMENTS (hw_compat_9_2); +GlobalProperty hw_compat_9_1[] = { {TYPE_PCI_DEVICE ,"x-pcie-ext-tag" ,"false" }, };
hw/i386/pc.c +3 -0
@@ -79,6 +79,9 @@ { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, +GlobalProperty pc_compat_9_2[] = {}; +const size_t pc_compat_9_2_len =G_N_ELEMENTS (pc_compat_9_2); +GlobalProperty pc_compat_9_1[] = { {"ICH9-LPC" ,"x-smi-swsmi-timer" ,"off" }, { "ICH9-LPC", "x-smi-periodic-timer", "off" },
hw/i386/pc_piix.c +11 -2
@@ -477,12 +477,21 @@ static void pc_i440fx_machine_options(MachineClass *m) "Use a different south bridge than PIIX3"); } -static void pc_i440fx_machine_9_2_options (MachineClass *m) +static void pc_i440fx_machine_10_0_options (MachineClass *m) {pc_i440fx_machine_options (m); } -DEFINE_I440FX_MACHINE_AS_LATEST (9 ,2 ); +DEFINE_I440FX_MACHINE_AS_LATEST (10 ,0 ); + +static void pc_i440fx_machine_9_2_options (MachineClass *m) +{ +pc_i440fx_machine_10_0_options (m); +compat_props_add (m->compat_props, hw_compat_9_2, hw_compat_9_2_len); +compat_props_add (m->compat_props, pc_compat_9_2, pc_compat_9_2_len); +} + +DEFINE_I440FX_MACHINE (9 ,2 );static void pc_i440fx_machine_9_1_options (MachineClass *m) {
hw/i386/pc_q35.c +11 -2
@@ -359,12 +359,21 @@ static void pc_q35_machine_options(MachineClass *m) pc_q35_compat_defaults, pc_q35_compat_defaults_len); } -static void pc_q35_machine_9_2_options (MachineClass *m) +static void pc_q35_machine_10_0_options (MachineClass *m) {pc_q35_machine_options (m); } -DEFINE_Q35_MACHINE_AS_LATEST (9 ,2 ); +DEFINE_Q35_MACHINE_AS_LATEST (10 ,0 ); + +static void pc_q35_machine_9_2_options (MachineClass *m) +{ +pc_q35_machine_10_0_options (m); +compat_props_add (m->compat_props, hw_compat_9_2, hw_compat_9_2_len); +compat_props_add (m->compat_props, pc_compat_9_2, pc_compat_9_2_len); +} + +DEFINE_Q35_MACHINE (9 ,2 );static void pc_q35_machine_9_1_options (MachineClass *m) {
hw/m68k/virt.c +8 -1
@@ -366,10 +366,17 @@ type_init(virt_machine_register_types)#define DEFINE_VIRT_MACHINE (major, minor) \ DEFINE_VIRT_MACHINE_IMPL(false, major, minor) +static void virt_machine_10_0_options (MachineClass *mc) +{ +} +DEFINE_VIRT_MACHINE_AS_LATEST(10, 0) +static void virt_machine_9_2_options (MachineClass *mc) { +virt_machine_10_0_options (mc); +compat_props_add (mc->compat_props, hw_compat_9_2, hw_compat_9_2_len); } -DEFINE_VIRT_MACHINE_AS_LATEST(9, 2) +DEFINE_VIRT_MACHINE(9, 2)static void virt_machine_9_1_options (MachineClass *mc) {
hw/ppc/spapr.c +13 -2
@@ -4732,15 +4732,26 @@ static void spapr_machine_latest_class_options(MachineClass *mc)#define DEFINE_SPAPR_MACHINE (major, minor) \ DEFINE_SPAPR_MACHINE_IMPL(false, major, minor) +/* +* pseries-10.0 +*/ +static void spapr_machine_10_0_class_options (MachineClass *mc) +{ +/* Defaults for the latest behaviour inherited from the base class */ +} + +DEFINE_SPAPR_MACHINE_AS_LATEST (10 ,0 ); +/* * pseries-9.2 */ static void spapr_machine_9_2_class_options (MachineClass *mc) { -/* Defaults for the latest behaviour inherited from the base class */ +spapr_machine_10_0_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_9_2, hw_compat_9_2_len); } -DEFINE_SPAPR_MACHINE_AS_LATEST (9 ,2 ); +DEFINE_SPAPR_MACHINE (9 ,2 );/* * pseries-9.1
hw/s390x/s390-virtio-ccw.c +13 -1
@@ -849,14 +849,26 @@ static const TypeInfo ccw_machine_info = { DEFINE_CCW_MACHINE_IMPL(false, major, minor) +static void ccw_machine_10_0_instance_options (MachineState *machine) +{ +} + +static void ccw_machine_10_0_class_options (MachineClass *mc) +{ +} +DEFINE_CCW_MACHINE_AS_LATEST (10 ,0 ); +static void ccw_machine_9_2_instance_options (MachineState *machine) { +ccw_machine_10_0_instance_options (machine); }static void ccw_machine_9_2_class_options (MachineClass *mc) { +ccw_machine_10_0_class_options (mc); +compat_props_add (mc->compat_props, hw_compat_9_2, hw_compat_9_2_len); } -DEFINE_CCW_MACHINE_AS_LATEST (9 ,2 ); +DEFINE_CCW_MACHINE (9 ,2 );static void ccw_machine_9_1_instance_options (MachineState *machine) {
include/hw/boards.h +3 -0
@@ -756,6 +756,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) +extern GlobalProperty hw_compat_9_2[]; +extern const size_t hw_compat_9_2_len; +extern GlobalProperty hw_compat_9_1[];extern const size_t hw_compat_9_1_len;
include/hw/i386/pc.h +3 -0
@@ -215,6 +215,9 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size);/* sgx.c */ void pc_machine_init_sgx_epc (PCMachineState *pcms); +extern GlobalProperty pc_compat_9_2[]; +extern const size_t pc_compat_9_2_len; +extern GlobalProperty pc_compat_9_1[];extern const size_t pc_compat_9_1_len;
Signature · 1 line
2.47.0
Re: [PATCH for-10.0 2/2] hw: add compat machines for 10.0
Quoted 15 lines · Cornelia Huck
Add 10.0 machine types for arm/i440fx/m68k/q35/s390x/spapr.
Signed-off-by Cornelia Huck <[email protected]>--- hw/arm/virt.c | 9 ++++++++- hw/core/machine.c | 3 +++ hw/i386/pc.c | 3 +++ hw/i386/pc_piix.c | 13 +++++++++++-- hw/i386/pc_q35.c | 13 +++++++++++-- hw/m68k/virt.c | 9 ++++++++- hw/ppc/spapr.c | 15 +++++++++++++-- hw/s390x/s390-virtio-ccw.c | 14 +++++++++++++- include/hw/boards.h | 3 +++ include/hw/i386/pc.h | 3 +++ 10 files changed, 76 insertions(+), 9 deletions(-)