diff mbox

[v2,06/13] pc: Define PC_COMPAT_2_[123] macros

Message ID 1431629590-25181-7-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost May 14, 2015, 6:53 p.m. UTC
Once 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.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 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(-)
diff mbox

Patch

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 25da8a5..8796e60 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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 */ }
     },
 };
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index d0d70e8..0051666 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -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 */ }
     },
 };
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index ab862e3..672f1f7 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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",\