pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros
v2 cover pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros
This series does some changes to make the macros more consistent. Now every pc and pseries version has a corresponding compat macro defined.
Changes v1 -> v2:
* Rebase after the new PC 2.4 machine-types were added
Eduardo Habkost (13):
pc: Replace tab with spaces
hw: Move commas inside HW_COMPAT_2_1 macro
pc: Move commas inside PC_COMPAT_* macros
spapr: Move commas inside SPAPR_COMPAT_* macros
hw: Define empty HW_COMPAT_2_[23] macros
pc: Define PC_COMPAT_2_[123] macros
spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros
spapr: define SPAPR_COMPAT_2_3
piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14
piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11
piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13
piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13
piix: Define PC_COMPAT_0_10
hw/i386/pc_piix.c | 185 +++++++++++++++++++++++++-------------------------- hw/i386/pc_q35.c | 20 ++++-- hw/ppc/spapr.c | 15 +++-- include/hw/compat.h | 8 ++- include/hw/i386/pc.h | 43 +++++++----- 5 files changed, 150 insertions(+), 121 deletions(-)
Signature · 1 line
2.1.0
PATCH v2 1/13 pc: Replace tab with spaces
Coding style change only.
--- hw/i386/pc_piix.c | 2 +- include/hw/i386/pc.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)
hw/i386/pc_piix.c +1 -1
@@ -628,7 +628,7 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { };#define PC_COMPAT_1_3 \ - PC_COMPAT_1_4, \ + PC_COMPAT_1_4, \ {\ .driver = "usb-tablet",\ .property = "usb_version",\
include/hw/i386/pc.h +6 -6
@@ -447,23 +447,23 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "scsi-hd",\ .property = "discard_granularity",\ .value = stringify(0),\ - },{\ + },{\ .driver = "scsi-cd",\ .property = "discard_granularity",\ .value = stringify(0),\ - },{\ + },{\ .driver = "scsi-disk",\ .property = "discard_granularity",\ .value = stringify(0),\ - },{\ + },{\ .driver = "ide-hd",\ .property = "discard_granularity",\ .value = stringify(0),\ - },{\ + },{\ .driver = "ide-cd",\ .property = "discard_granularity",\ .value = stringify(0),\ - },{\ + },{\ .driver = "ide-drive",\ .property = "discard_granularity",\ .value = stringify(0),\
@@ -471,7 +471,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "virtio-blk-pci",\ .property = "discard_granularity",\ .value = stringify(0),\ - },{\ + },{\ .driver = "virtio-serial-pci",\ .property = "vectors",\ /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\
Signature · 1 line
2.1.0
PATCH v2 2/13 hw: Move commas inside HW_COMPAT_2_1 macro
In reply to Eduardo HabkostChanging the convention to include commas inside the macros will allow macros containing empty lists to be defined and used without compilation errors.
--- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/ppc/spapr.c | 2 +- include/hw/compat.h | 2 +- include/hw/i386/pc.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
hw/i386/pc_piix.c +1 -1
@@ -562,7 +562,7 @@ static QEMUMachine pc_i440fx_machine_v2_1 = { .name = "pc-i440fx-2.1", .init = pc_init_pci_2_1, .compat_props = (GlobalProperty []) { -HW_COMPAT_2_1 , + HW_COMPAT_2_1 {/* end of list */ } }, };
hw/i386/pc_q35.c +1 -1
@@ -458,7 +458,7 @@ static QEMUMachine pc_q35_machine_v2_1 = { .name = "pc-q35-2.1", .init = pc_q35_init_2_1, .compat_props = (GlobalProperty []) { -HW_COMPAT_2_1 , + HW_COMPAT_2_1 {/* end of list */ } }, };
hw/ppc/spapr.c +1 -1
@@ -1861,7 +1861,7 @@ static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) {MachineClass *mc =MACHINE_CLASS (oc);static GlobalProperty compat_props[] = { -HW_COMPAT_2_1 , + HW_COMPAT_2_1SPAPR_COMPAT_2_1 , {/* end of list */ } };
include/hw/compat.h +1 -1
@@ -30,6 +30,6 @@ .driver = "virtio-pci",\ .property = "virtio-pci-bus-master-bug-migration",\ .value = "on",\ - } + },#endif /* HW_COMPAT_H */
include/hw/i386/pc.h +1 -1
@@ -296,7 +296,7 @@ int e820_get_num_entries(void);bool e820_get_entry (int ,uint32_t ,uint64_t *,uint64_t *);#define PC_COMPAT_2_0 \ - HW_COMPAT_2_1, \ + HW_COMPAT_2_1 \ {\ .driver = "virtio-scsi-pci",\ .property = "any_layout",\
Signature · 1 line
2.1.0
PATCH v2 3/13 pc: Move commas inside PC_COMPAT_* macros
In reply to Eduardo HabkostChanging the convention to include commas inside the macros will allow macros containing empty lists to be defined and used without compilation errors.
--- hw/i386/pc_piix.c | 62 ++++++++++++++++++++++++++-------------------------- hw/i386/pc_q35.c | 10 ++++----- include/hw/i386/pc.h | 18 +++++++-------- 3 files changed, 45 insertions(+), 45 deletions(-)
hw/i386/pc_piix.c +31 -31
@@ -574,7 +574,7 @@ static QEMUMachine pc_i440fx_machine_v2_0 = { .name = "pc-i440fx-2.0", .init = pc_init_pci_2_0, .compat_props = (GlobalProperty []) { -PC_COMPAT_2_0 , + PC_COMPAT_2_0 {/* end of list */ } }, };
@@ -586,7 +586,7 @@ static QEMUMachine pc_i440fx_machine_v1_7 = { .name = "pc-i440fx-1.7", .init = pc_init_pci_1_7, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_7 , + PC_COMPAT_1_7 {/* end of list */ } }, };
@@ -598,7 +598,7 @@ static QEMUMachine pc_i440fx_machine_v1_6 = { .name = "pc-i440fx-1.6", .init = pc_init_pci_1_6, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_6 , + PC_COMPAT_1_6 {/* end of list */ } }, };
@@ -608,7 +608,7 @@ static QEMUMachine pc_i440fx_machine_v1_5 = { .name = "pc-i440fx-1.5", .init = pc_init_pci_1_5, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_5 , + PC_COMPAT_1_5 {/* end of list */ } }, };
@@ -622,13 +622,13 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { .name = "pc-i440fx-1.4", .init = pc_init_pci_1_4, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_4 , + PC_COMPAT_1_4 {/* end of list */ } }, };#define PC_COMPAT_1_3 \ - PC_COMPAT_1_4, \ + PC_COMPAT_1_4 \ {\ .driver = "usb-tablet",\ .property = "usb_version",\
@@ -645,20 +645,20 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { .driver = "e1000",\ .property = "autonegotiation",\ .value = "off",\ - } + },static QEMUMachine pc_machine_v1_3 = {PC_I440FX_1_4_MACHINE_OPTIONS , .name ="pc-1.3" , .init = pc_init_pci_1_3, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_3 , + PC_COMPAT_1_3 {/* end of list */ } }, };#define PC_COMPAT_1_2 \ - PC_COMPAT_1_3,\ + PC_COMPAT_1_3 \ {\ .driver = "nec-usb-xhci",\ .property = "msi",\
@@ -683,7 +683,7 @@ static QEMUMachine pc_machine_v1_3 = { .driver = "VGA",\ .property = "mmio",\ .value = "off",\ - } + },#define PC_I440FX_1_2_MACHINE_OPTIONS \ PC_I440FX_1_4_MACHINE_OPTIONS, \
@@ -693,13 +693,13 @@ static QEMUMachine pc_machine_v1_2 = { PC_I440FX_1_2_MACHINE_OPTIONS, .name = "pc-1.2", .compat_props = (GlobalProperty []) { -PC_COMPAT_1_2 , + PC_COMPAT_1_2 {/* end of list */ } }, };#define PC_COMPAT_1_1 \ - PC_COMPAT_1_2,\ + PC_COMPAT_1_2 \ {\ .driver = "virtio-scsi-pci",\ .property = "hotplug",\
@@ -728,19 +728,19 @@ static QEMUMachine pc_machine_v1_2 = { .driver = "virtio-blk-pci",\ .property = "config-wce",\ .value = "off",\ - } + },static QEMUMachine pc_machine_v1_1 = {PC_I440FX_1_2_MACHINE_OPTIONS , .name ="pc-1.1" , .compat_props = (GlobalProperty []) { -PC_COMPAT_1_1 , + PC_COMPAT_1_1 {/* end of list */ } }, };#define PC_COMPAT_1_0 \ - PC_COMPAT_1_1,\ + PC_COMPAT_1_1 \ {\ .driver = TYPE_ISA_FDC,\ .property = "check_media_rate",\
@@ -757,13 +757,13 @@ static QEMUMachine pc_machine_v1_1 = { .driver = TYPE_USB_DEVICE,\ .property = "full-path",\ .value = "no",\ - } + },static QEMUMachine pc_machine_v1_0 = {PC_I440FX_1_2_MACHINE_OPTIONS , .name ="pc-1.0" , .compat_props = (GlobalProperty []) { -PC_COMPAT_1_0 , + PC_COMPAT_1_0 {/* end of list */ } }, .hw_version ="1.0" ,
@@ -776,14 +776,14 @@ static QEMUMachine pc_machine_v0_15 = { PC_I440FX_1_2_MACHINE_OPTIONS, .name = "pc-0.15", .compat_props = (GlobalProperty []) { -PC_COMPAT_0_15 , + PC_COMPAT_0_15 {/* end of list */ } }, .hw_version = "0.15", };#define PC_COMPAT_0_14 \ - PC_COMPAT_0_15,\ + PC_COMPAT_0_15 \ {\ .driver = "virtio-blk-pci",\ .property = "event_idx",\
@@ -800,13 +800,13 @@ static QEMUMachine pc_machine_v0_15 = { .driver = "virtio-balloon-pci",\ .property = "event_idx",\ .value = "off",\ - } + }, static QEMUMachine pc_machine_v0_14 = {PC_I440FX_1_2_MACHINE_OPTIONS , .name ="pc-0.14" , .compat_props = (GlobalProperty []) { -PC_COMPAT_0_14 , +PC_COMPAT_0_14 { .driver ="qxl" , .property ="revision" ,
@@ -822,7 +822,7 @@ static QEMUMachine pc_machine_v0_14 = { };#define PC_COMPAT_0_13 \ - PC_COMPAT_0_14,\ + PC_COMPAT_0_14 \ {\ .driver = TYPE_PCI_DEVICE,\ .property = "command_serr_enable",\
@@ -831,7 +831,7 @@ static QEMUMachine pc_machine_v0_14 = { .driver = "AC97",\ .property = "use_broken_id",\ .value = stringify(1),\ - } + },#define PC_I440FX_0_13_MACHINE_OPTIONS \ PC_I440FX_1_2_MACHINE_OPTIONS, \
@@ -841,7 +841,7 @@ static QEMUMachine pc_machine_v0_13 = { PC_I440FX_0_13_MACHINE_OPTIONS, .name = "pc-0.13", .compat_props = (GlobalProperty[]) { -PC_COMPAT_0_13 , + PC_COMPAT_0_13 { .driver = "virtio-9p-pci", .property = "vectors",
@@ -861,7 +861,7 @@ static QEMUMachine pc_machine_v0_13 = { };#define PC_COMPAT_0_12 \ - PC_COMPAT_0_13,\ + PC_COMPAT_0_13 \ {\ .driver = "virtio-serial-pci",\ .property = "max_ports",\
@@ -882,13 +882,13 @@ static QEMUMachine pc_machine_v0_13 = { .driver = "usb-kbd",\ .property = "serial",\ .value = "1",\ - } + }, static QEMUMachine pc_machine_v0_12 = {PC_I440FX_0_13_MACHINE_OPTIONS , .name ="pc-0.12" , .compat_props = (GlobalProperty []) { -PC_COMPAT_0_12 , +PC_COMPAT_0_12 { .driver ="VGA" , .property ="rombar" ,
@@ -904,7 +904,7 @@ static QEMUMachine pc_machine_v0_12 = { };#define PC_COMPAT_0_11 \ - PC_COMPAT_0_12,\ + PC_COMPAT_0_12 \ {\ .driver = "virtio-blk-pci",\ .property = "vectors",\
@@ -913,13 +913,13 @@ static QEMUMachine pc_machine_v0_12 = { .driver = TYPE_PCI_DEVICE,\ .property = "rombar",\ .value = stringify(0),\ - } + }, static QEMUMachine pc_machine_v0_11 = {PC_I440FX_0_13_MACHINE_OPTIONS , .name ="pc-0.11" , .compat_props = (GlobalProperty []) { -PC_COMPAT_0_11 , +PC_COMPAT_0_11 { .driver ="ide-drive" , .property ="ver" ,
@@ -938,7 +938,7 @@ static QEMUMachine pc_machine_v0_10 = { PC_I440FX_0_13_MACHINE_OPTIONS, .name = "pc-0.10", .compat_props = (GlobalProperty[]) { -PC_COMPAT_0_11 , + PC_COMPAT_0_11 { .driver = "virtio-blk-pci", .property = "class",
hw/i386/pc_q35.c +5 -5
@@ -470,7 +470,7 @@ static QEMUMachine pc_q35_machine_v2_0 = { .name = "pc-q35-2.0", .init = pc_q35_init_2_0, .compat_props = (GlobalProperty []) { -PC_COMPAT_2_0 , + PC_COMPAT_2_0 {/* end of list */ } }, };
@@ -482,7 +482,7 @@ static QEMUMachine pc_q35_machine_v1_7 = { .name = "pc-q35-1.7", .init = pc_q35_init_1_7, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_7 , + PC_COMPAT_1_7 {/* end of list */ } }, };
@@ -494,7 +494,7 @@ static QEMUMachine pc_q35_machine_v1_6 = { .name = "pc-q35-1.6", .init = pc_q35_init_1_6, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_6 , + PC_COMPAT_1_6 {/* end of list */ } }, };
@@ -504,7 +504,7 @@ static QEMUMachine pc_q35_machine_v1_5 = { .name = "pc-q35-1.5", .init = pc_q35_init_1_5, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_5 , + PC_COMPAT_1_5 {/* end of list */ } }, };
@@ -518,7 +518,7 @@ static QEMUMachine pc_q35_machine_v1_4 = { .name = "pc-q35-1.4", .init = pc_q35_init_1_4, .compat_props = (GlobalProperty []) { -PC_COMPAT_1_4 , + PC_COMPAT_1_4 {/* end of list */ } }, };
include/hw/i386/pc.h +9 -9
@@ -353,10 +353,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "ioh3420",\ .property = COMPAT_PROP_PCP,\ .value = "off",\ - } + },#define PC_COMPAT_1_7 \ - PC_COMPAT_2_0, \ + PC_COMPAT_2_0 \ {\ .driver = TYPE_USB_DEVICE,\ .property = "msos-desc",\
@@ -371,10 +371,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "hpet",\ .property = HPET_INTCAP,\ .value = stringify(4),\ - } + },#define PC_COMPAT_1_6 \ - PC_COMPAT_1_7, \ + PC_COMPAT_1_7 \ {\ .driver = "e1000",\ .property = "mitigation",\
@@ -395,10 +395,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "q35-pcihost",\ .property = "short_root_bus",\ .value = stringify(1),\ - } + },#define PC_COMPAT_1_5 \ - PC_COMPAT_1_6, \ + PC_COMPAT_1_6 \ {\ .driver = "Conroe-" TYPE_X86_CPU,\ .property = "model",\
@@ -439,10 +439,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "q35-pcihost",\ .property = "short_root_bus",\ .value = stringify(0),\ - } + },#define PC_COMPAT_1_4 \ - PC_COMPAT_1_5, \ + PC_COMPAT_1_5 \ {\ .driver = "scsi-hd",\ .property = "discard_granularity",\
@@ -504,7 +504,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "486-" TYPE_X86_CPU,\ .property = "model",\ .value = stringify(0),\ - } + },#define PC_COMMON_MACHINE_OPTIONS \ .default_boot_order = "cad"
Signature · 1 line
2.1.0
PATCH v2 4/13 spapr: Move commas inside SPAPR_COMPAT_* macros
In reply to Eduardo HabkostChanging the convention to include commas inside the macros will allow macros containing empty lists to be defined and used without compilation errors.
--- hw/ppc/spapr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/ppc/spapr.c +3 -3
@@ -1820,7 +1820,7 @@ static const TypeInfo spapr_machine_info = { .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\ .property = "mem_win_size",\ .value = "0x20000000",\ - } + },#define SPAPR_COMPAT_2_1 \ SPAPR_COMPAT_2_2
@@ -1862,7 +1862,7 @@ static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data)MachineClass *mc =MACHINE_CLASS (oc);static GlobalProperty compat_props[] = { HW_COMPAT_2_1 -SPAPR_COMPAT_2_1 , + SPAPR_COMPAT_2_1 {/* end of list */ } };
@@ -1881,7 +1881,7 @@ static const TypeInfo spapr_machine_2_1_info = {static void spapr_machine_2_2_class_init (ObjectClass *oc,void *data) {static GlobalProperty compat_props[] = { -SPAPR_COMPAT_2_2 , + SPAPR_COMPAT_2_2 {/* end of list */ } };MachineClass *mc =MACHINE_CLASS (oc);
Signature · 1 line
2.1.0
PATCH v2 5/13 hw: Define empty HW_COMPAT_2_[23] macros
In reply to Eduardo HabkostNow we can make everything consistent and define the macros even if they are still empty.
--- include/hw/compat.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/hw/compat.h +6 -0
@@ -1,6 +1,12 @@#ifndef HW_COMPAT_H #define HW_COMPAT_H +#define HW_COMPAT_2_3 \ +/* empty */ + +#define HW_COMPAT_2_2 \ +/* empty */ +#define HW_COMPAT_2_1 \ {\ .driver = "intel-hda",\
Signature · 1 line
2.1.0
PATCH v2 6/13 pc: Define PC_COMPAT_2_[123] macros
In reply to Eduardo HabkostOnce we start adding compat code for pc-2.3, the usage of HW_COMPAT_2_1 in pc-*-2.2 won't be enough, as it also has to include PC_COMPAT_2_3 inside it. To ensure that, define PC_COMPAT_2_3, PC_COMPAT_2_2, and PC_COMPAT_2_1 macros.
--- hw/i386/pc_piix.c | 10 +++++++++- hw/i386/pc_q35.c | 10 +++++++++- include/hw/i386/pc.h | 13 ++++++++++++- 3 files changed, 30 insertions(+), 3 deletions(-)
hw/i386/pc_piix.c +9 -1
@@ -543,6 +543,10 @@ static QEMUMachine pc_i440fx_machine_v2_3 = { PC_I440FX_2_3_MACHINE_OPTIONS, .name = "pc-i440fx-2.3", .init = pc_init_pci_2_3, + .compat_props = (GlobalProperty []) { + PC_COMPAT_2_3 + {/* end of list */ } + }, };#define PC_I440FX_2_2_MACHINE_OPTIONS PC_I440FX_2_3_MACHINE_OPTIONS
@@ -551,6 +555,10 @@ static QEMUMachine pc_i440fx_machine_v2_2 = { PC_I440FX_2_2_MACHINE_OPTIONS, .name = "pc-i440fx-2.2", .init = pc_init_pci_2_2, + .compat_props = (GlobalProperty []) { + PC_COMPAT_2_2 + {/* end of list */ } + }, };#define PC_I440FX_2_1_MACHINE_OPTIONS \
@@ -562,7 +570,7 @@ static QEMUMachine pc_i440fx_machine_v2_1 = { .name = "pc-i440fx-2.1", .init = pc_init_pci_2_1, .compat_props = (GlobalProperty []) { - HW_COMPAT_2_1 + PC_COMPAT_2_1 {/* end of list */ } }, };
hw/i386/pc_q35.c +9 -1
@@ -439,6 +439,10 @@ static QEMUMachine pc_q35_machine_v2_3 = { PC_Q35_2_3_MACHINE_OPTIONS, .name = "pc-q35-2.3", .init = pc_q35_init_2_3, + .compat_props = (GlobalProperty []) { + PC_COMPAT_2_3 + {/* end of list */ } + }, };#define PC_Q35_2_2_MACHINE_OPTIONS PC_Q35_2_3_MACHINE_OPTIONS
@@ -447,6 +451,10 @@ static QEMUMachine pc_q35_machine_v2_2 = { PC_Q35_2_2_MACHINE_OPTIONS, .name = "pc-q35-2.2", .init = pc_q35_init_2_2, + .compat_props = (GlobalProperty []) { + PC_COMPAT_2_2 + {/* end of list */ } + }, };#define PC_Q35_2_1_MACHINE_OPTIONS \
@@ -458,7 +466,7 @@ static QEMUMachine pc_q35_machine_v2_1 = { .name = "pc-q35-2.1", .init = pc_q35_init_2_1, .compat_props = (GlobalProperty []) { - HW_COMPAT_2_1 + PC_COMPAT_2_1 {/* end of list */ } }, };
include/hw/i386/pc.h +12 -1
@@ -295,8 +295,19 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t);int e820_get_num_entries (void );bool e820_get_entry (int ,uint32_t ,uint64_t *,uint64_t *); +#define PC_COMPAT_2_3 \ + HW_COMPAT_2_3 + +#define PC_COMPAT_2_2 \ + PC_COMPAT_2_3 \ + HW_COMPAT_2_2 + +#define PC_COMPAT_2_1 \ + PC_COMPAT_2_2 \ + HW_COMPAT_2_1 +#define PC_COMPAT_2_0 \ - HW_COMPAT_2_1 \ + PC_COMPAT_2_1 \ {\ .driver = "virtio-scsi-pci",\ .property = "any_layout",\
Signature · 1 line
2.1.0
PATCH v2 7/13 spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros
In reply to Eduardo HabkostSPAPR_COMPAT_2_1 will need to include both HW_COMPAT_2_2 and HW_COMPAT_2_1, so include HW_COMPAT_2_1 inside SPAPR_COMPAT_2_1 and HW_COMPAT_2_2 inside SPAPR_COMPAT_2_2.
--- hw/ppc/spapr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/ppc/spapr.c +3 -2
@@ -1816,6 +1816,7 @@ static const TypeInfo spapr_machine_info = { };#define SPAPR_COMPAT_2_2 \ + HW_COMPAT_2_2 \ {\ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\ .property = "mem_win_size",\
@@ -1823,7 +1824,8 @@ static const TypeInfo spapr_machine_info = { },#define SPAPR_COMPAT_2_1 \ - SPAPR_COMPAT_2_2 + SPAPR_COMPAT_2_2 \ + HW_COMPAT_2_1static void spapr_compat_2_3 (Object *obj) {
@@ -1861,7 +1863,6 @@ static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) {MachineClass *mc =MACHINE_CLASS (oc);static GlobalProperty compat_props[] = { - HW_COMPAT_2_1 SPAPR_COMPAT_2_1 {/* end of list */ } };
Signature · 1 line
2.1.0
PATCH v2 8/13 spapr: define SPAPR_COMPAT_2_3
In reply to Eduardo HabkostDon't add the pseries-2.3 machine yet, but define the corresponding SPAPR_COMPAT macro to make sure both pseries-2.2 and pseries-2.1 will inherit HW_COMPAT_2_3.
--- hw/ppc/spapr.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/ppc/spapr.c +4 -0
@@ -1815,7 +1815,11 @@ static const TypeInfo spapr_machine_info = { }, }; +#define SPAPR_COMPAT_2_3 \ + HW_COMPAT_2_3 +#define SPAPR_COMPAT_2_2 \ + SPAPR_COMPAT_2_3 \ HW_COMPAT_2_2 \ {\ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\
Signature · 1 line
2.1.0
PATCH v2 9/13 piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14
In reply to Eduardo HabkostThose properties were introduced by commit 3827cdb1c3aa17a792d1658161195b9d7173c26b. They were not duplicated into pc-0.13 and older because 0.14 was the first QEMU version supporting qxl. The only problem is that this breaks the PC_COMPAT_* nesting pattern we currently use.
So, move the properties to PC_COMPAT_0_14. This makes pc-0.13 and older inherit them, but that shouldn't be an issue as QEMU 0.13 didn't support qxl.
--- hw/i386/pc_piix.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
hw/i386/pc_piix.c +8 -9
@@ -808,6 +808,14 @@ static QEMUMachine pc_machine_v0_15 = { .driver = "virtio-balloon-pci",\ .property = "event_idx",\ .value = "off",\ + },{\ + .driver = "qxl",\ + .property = "revision",\ + .value = stringify(2),\ + },{\ + .driver = "qxl-vga",\ + .property = "revision",\ + .value = stringify(2),\ }, static QEMUMachine pc_machine_v0_14 = {
@@ -815,15 +823,6 @@ static QEMUMachine pc_machine_v0_14 = { .name = "pc-0.14", .compat_props = (GlobalProperty []) { PC_COMPAT_0_14 - { - .driver ="qxl" , - .property ="revision" , - .value =stringify (2 ), - },{ - .driver ="qxl-vga" , - .property ="revision" , - .value =stringify (2 ), - }, {/* end of list */ } }, .hw_version = "0.14",
Signature · 1 line
2.1.0
PATCH v2 10/13 piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11
In reply to Eduardo HabkostThe current code setting ide-drive.ver and scsi-disk.ver on pc-0.11 breaks the PC_COMPAT_* nesting pattern we currently use.
As those variables are overwritten in pc-0.10 too, they can be inherited by pc-0.10 with no side-effects at all.
--- hw/i386/pc_piix.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
hw/i386/pc_piix.c +8 -9
@@ -920,6 +920,14 @@ static QEMUMachine pc_machine_v0_12 = { .driver = TYPE_PCI_DEVICE,\ .property = "rombar",\ .value = stringify(0),\ + },{\ + .driver = "ide-drive",\ + .property = "ver",\ + .value = "0.11",\ + },{\ + .driver = "scsi-disk",\ + .property = "ver",\ + .value = "0.11",\ }, static QEMUMachine pc_machine_v0_11 = {
@@ -927,15 +935,6 @@ static QEMUMachine pc_machine_v0_11 = { .name = "pc-0.11", .compat_props = (GlobalProperty []) { PC_COMPAT_0_11 - { - .driver ="ide-drive" , - .property ="ver" , - .value ="0.11" , - },{ - .driver ="scsi-disk" , - .property ="ver" , - .value ="0.11" , - }, {/* end of list */ } }, .hw_version = "0.11",
Signature · 1 line
2.1.0
PATCH v2 11/13 piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13
In reply to Eduardo HabkostThe compat property was added by commit 9dbcca5aa13cb9ab40788ac4c56bc227d94ca920, and the pc-0.12 and older machine-types were not changed because virtio-9p-pci was introduced on QEMU 0.13 (commit 9f10751365b26b13b8a9b67e0e90536ae3d282df). The only problem is that this breaks the PC_COMPAT_* nesting pattern we currently use.
So, move the property to PC_COMPAT_0_13. This make pc-0.12 and older inherit it, but that shouldn't be an issue as QEMU 0.12 didn't have virtio-9p-pci.
--- hw/i386/pc_piix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +4 -4
@@ -838,6 +838,10 @@ static QEMUMachine pc_machine_v0_14 = { .driver = "AC97",\ .property = "use_broken_id",\ .value = stringify(1),\ + },{\ + .driver = "virtio-9p-pci",\ + .property = "vectors",\ + .value = stringify(0),\ },#define PC_I440FX_0_13_MACHINE_OPTIONS \
@@ -850,10 +854,6 @@ static QEMUMachine pc_machine_v0_13 = { .compat_props = (GlobalProperty[]) { PC_COMPAT_0_13 { - .driver ="virtio-9p-pci" , - .property ="vectors" , - .value =stringify (0 ), - },{ .driver = "VGA", .property = "rombar", .value = stringify(0),
Signature · 1 line
2.1.0
PATCH v2 12/13 piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13
In reply to Eduardo HabkostThe VGA and vmware-svga rombar compat properties were added by commit 281a26b15b4adcecb8604216738975abd754bea8, but only to pc-0.13 and pc-0.12. This breaks the PC_COMPAT_* nesting pattern we currently follow.
The new variables will now be inherited by pc-0.11 and older, but pc-0.11 and pc-0.10 already have PCI.rombar=0 on compat_props, so they shouldn't be affected at all.
--- hw/i386/pc_piix.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
hw/i386/pc_piix.c +8 -18
@@ -842,6 +842,14 @@ static QEMUMachine pc_machine_v0_14 = { .driver = "virtio-9p-pci",\ .property = "vectors",\ .value = stringify(0),\ + },{\ + .driver = "VGA",\ + .property = "rombar",\ + .value = stringify(0),\ + },{\ + .driver = "vmware-svga",\ + .property = "rombar",\ + .value = stringify(0),\ }, #define PC_I440FX_0_13_MACHINE_OPTIONS \
@@ -853,15 +861,6 @@ static QEMUMachine pc_machine_v0_13 = { .name = "pc-0.13", .compat_props = (GlobalProperty []) { PC_COMPAT_0_13 - { - .driver ="VGA" , - .property ="rombar" , - .value =stringify (0 ), - },{ - .driver ="vmware-svga" , - .property ="rombar" , - .value =stringify (0 ), - }, {/* end of list */ } }, .hw_version = "0.13",
@@ -896,15 +895,6 @@ static QEMUMachine pc_machine_v0_12 = { .name = "pc-0.12", .compat_props = (GlobalProperty []) { PC_COMPAT_0_12 - { - .driver ="VGA" , - .property ="rombar" , - .value =stringify (0 ), - },{ - .driver ="vmware-svga" , - .property ="rombar" , - .value =stringify (0 ), - }, {/* end of list */ } }, .hw_version = "0.12",
Signature · 1 line
2.1.0
PATCH v2 13/13 piix: Define PC_COMPAT_0_10
In reply to Eduardo HabkostMove compat_props from pc-0.10 to the macro, to make it consistent with the other machines.
--- hw/i386/pc_piix.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-)
hw/i386/pc_piix.c +25 -22
@@ -930,32 +930,35 @@ static QEMUMachine pc_machine_v0_11 = { .hw_version = "0.11", }; +#define PC_COMPAT_0_10 \ + PC_COMPAT_0_11 \ + {\ + .driver = "virtio-blk-pci",\ + .property = "class",\ + .value = stringify(PCI_CLASS_STORAGE_OTHER),\ + },{\ + .driver = "virtio-serial-pci",\ + .property = "class",\ + .value = stringify(PCI_CLASS_DISPLAY_OTHER),\ + },{\ + .driver = "virtio-net-pci",\ + .property = "vectors",\ + .value = stringify(0),\ + },{\ + .driver = "ide-drive",\ + .property = "ver",\ + .value = "0.10",\ + },{\ + .driver = "scsi-disk",\ + .property = "ver",\ + .value = "0.10",\ + }, +static QEMUMachine pc_machine_v0_10 = {PC_I440FX_0_13_MACHINE_OPTIONS , .name ="pc-0.10" , .compat_props = (GlobalProperty []) { -PC_COMPAT_0_11 - { - .driver ="virtio-blk-pci" , - .property ="class" , - .value =stringify (PCI_CLASS_STORAGE_OTHER ), - },{ - .driver ="virtio-serial-pci" , - .property ="class" , - .value =stringify (PCI_CLASS_DISPLAY_OTHER ), - },{ - .driver ="virtio-net-pci" , - .property ="vectors" , - .value =stringify (0 ), - },{ - .driver ="ide-drive" , - .property ="ver" , - .value ="0.10" , - },{ - .driver ="scsi-disk" , - .property ="ver" , - .value ="0.10" , - }, + PC_COMPAT_0_10 {/* end of list */ } }, .hw_version ="0.10" ,
Signature · 1 line
2.1.0
Re: [Qemu-devel] [PATCH v2 09/13] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14
In reply to Eduardo HabkostQuoted 5 lines · Eduardo Habkost
So, move the properties to
PC_COMPAT_0_14. This makes pc-0.13 and older
inherit them, but that shouldn't be an issue as QEMU 0.13 didn't support
qxl.
Re: [Qemu-devel] [PATCH v2 10/13] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11
In reply to Eduardo HabkostQuoted 5 lines · Eduardo Habkost
The current code setting ide-drive.ver and scsi-disk.ver on pc-0.11 breaks the PC_COMPAT_* nesting pattern we currently use.
As those variables are overwritten in pc-0.10 too, they can be inherited by pc-0.10 with no side-effects at all.
Re: [Qemu-devel] [PATCH v2 11/13] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13
In reply to Eduardo HabkostQuoted 8 lines · Eduardo Habkost
The compat property was added by commit
9dbcca5aa13cb9ab40788ac4c56bc227d94ca920, and the pc-0.12 and older machine-types were not changed because virtio-9p-pci was introduced on QEMU
0.13 (commit9f10751365b26b13b8a9b67e0e90536ae3d282df). The only problem is
that this breaks the PC_COMPAT_* nesting pattern we currently use.
Quoted 4 lines
So, move the property to
PC_COMPAT_0_13. This make pc-0.12 and older inherit
it, but that shouldn't be an issue as QEMU 0.12 didn't have virtio-9p-pci.
Re: [Qemu-devel] [PATCH v2 12/13] piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13
In reply to Eduardo HabkostQuoted 8 lines · Eduardo Habkost
The VGA and vmware-svga rombar compat properties were added by commit
281a26b15b4adcecb8604216738975abd754bea8, but only to pc-0.13 and pc-0.12. This breaks the PC_COMPAT_* nesting pattern we currently follow.The new variables will now be inherited by pc-0.11 and older, but pc-0.11 and pc-0.10 already have PCI.rombar=0 on
compat_props, so they shouldn't be affected at all.