Placeholder for the rest of the series, which changes a default on
the next machine version. The real "hw: add compat machines for 12.0"
covers every versioned board; this only adds pc-i440fx-12.0 and
pc-q35-12.0. Drop it once that commit lands.

Signed-off-by: Junjie Cao <[email protected]>
---
 hw/core/machine.c        |  3 +++
 hw/i386/pc.c             |  3 +++
 hw/i386/pc_piix.c        | 13 +++++++++++--
 hw/i386/pc_q35.c         | 13 +++++++++++--
 include/hw/core/boards.h |  3 +++
 include/hw/i386/pc.h     |  3 +++
 6 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index ed9bf8f500..5305521ac5 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -41,6 +41,9 @@
 #include "qemu/audio.h"
 #include "hw/arm/smmuv3.h"
 
+GlobalProperty hw_compat_11_2[] = {};
+const size_t hw_compat_11_2_len = G_N_ELEMENTS(hw_compat_11_2);
+
 GlobalProperty hw_compat_11_1[] = {
     { "sysbus-ehci-usb", "x-migrate-fetch-addr-64bit", "off" },
     { "pci-ehci-usb", "x-migrate-fetch-addr-64bit", "off" },
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 4737eb471c..8a6b7978cc 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -75,6 +75,9 @@
 #include "hw/xen/xen-bus.h"
 #endif
 
+GlobalProperty pc_compat_11_2[] = {};
+const size_t pc_compat_11_2_len = G_N_ELEMENTS(pc_compat_11_2);
+
 GlobalProperty pc_compat_11_1[] = {};
 const size_t pc_compat_11_1_len = G_N_ELEMENTS(pc_compat_11_1);
 
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 446590e4e5..c0ddf6011f 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -397,12 +397,21 @@ static void pc_i440fx_machine_options(MachineClass *m)
                      pc_piix_compat_defaults, pc_piix_compat_defaults_len);
 }
 
-static void pc_i440fx_machine_11_2_options(MachineClass *m)
+static void pc_i440fx_machine_12_0_options(MachineClass *m)
 {
     pc_i440fx_machine_options(m);
 }
 
-DEFINE_I440FX_MACHINE_AS_LATEST(11, 2);
+DEFINE_I440FX_MACHINE_AS_LATEST(12, 0);
+
+static void pc_i440fx_machine_11_2_options(MachineClass *m)
+{
+    pc_i440fx_machine_12_0_options(m);
+    compat_props_add(m->compat_props, hw_compat_11_2, hw_compat_11_2_len);
+    compat_props_add(m->compat_props, pc_compat_11_2, pc_compat_11_2_len);
+}
+
+DEFINE_I440FX_MACHINE(11, 2);
 
 static void pc_i440fx_machine_11_1_options(MachineClass *m)
 {
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index c3ce9c5649..e302ff283c 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -378,12 +378,21 @@ static void pc_q35_machine_options(MachineClass *m)
                      pc_q35_compat_defaults, pc_q35_compat_defaults_len);
 }
 
-static void pc_q35_machine_11_2_options(MachineClass *m)
+static void pc_q35_machine_12_0_options(MachineClass *m)
 {
     pc_q35_machine_options(m);
 }
 
-DEFINE_Q35_MACHINE_AS_LATEST(11, 2);
+DEFINE_Q35_MACHINE_AS_LATEST(12, 0);
+
+static void pc_q35_machine_11_2_options(MachineClass *m)
+{
+    pc_q35_machine_12_0_options(m);
+    compat_props_add(m->compat_props, hw_compat_11_2, hw_compat_11_2_len);
+    compat_props_add(m->compat_props, pc_compat_11_2, pc_compat_11_2_len);
+}
+
+DEFINE_Q35_MACHINE(11, 2);
 
 static void pc_q35_machine_11_1_options(MachineClass *m)
 {
diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h
index d0e4ad9820..2f2327079c 100644
--- a/include/hw/core/boards.h
+++ b/include/hw/core/boards.h
@@ -830,6 +830,9 @@ compat_props_add(GPtrArray *arr,
     }
 }
 
+extern GlobalProperty hw_compat_11_2[];
+extern const size_t hw_compat_11_2_len;
+
 extern GlobalProperty hw_compat_11_1[];
 extern const size_t hw_compat_11_1_len;
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 844ae83578..caceddc74b 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -214,6 +214,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_11_2[];
+extern const size_t pc_compat_11_2_len;
+
 extern GlobalProperty pc_compat_11_1[];
 extern const size_t pc_compat_11_1_len;
 
-- 
2.43.0


Reply via email to