qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros
@ 2015-05-11 20:55 Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 01/13] pc: Replace tab with spaces Eduardo Habkost
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

This series does some changes to make the macros more consistent. Now every pc
and pseries version has a corresponding compat macro defined.

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
  pc_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(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 01/13] pc: Replace tab with spaces
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 02/13] hw: Move commas inside HW_COMPAT_2_1 macro Eduardo Habkost
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

Coding style change only.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c    |  2 +-
 include/hw/i386/pc.h | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1fe7bfb..b4ec3ce 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -608,7 +608,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",\
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 1b35168..7ed43f1 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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 */\
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 02/13] hw: Move commas inside HW_COMPAT_2_1 macro
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 01/13] pc: Replace tab with spaces Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 03/13] pc: Move commas inside PC_COMPAT_* macros Eduardo Habkost
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

Changing the convention to include commas inside the macros will allow
macros containing empty lists to be defined and used without compilation
errors.

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

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index b4ec3ce..0536056 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -542,7 +542,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 */ }
     },
 };
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index dcc17c0..0248357 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -439,7 +439,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 */ }
     },
 };
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 644689a..5f67e17 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1829,7 +1829,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_1
         SPAPR_COMPAT_2_1,
         { /* end of list */ }
     };
diff --git a/include/hw/compat.h b/include/hw/compat.h
index 313682a..c56a698 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -30,6 +30,6 @@
             .driver   = "virtio-pci",\
             .property = "virtio-pci-bus-master-bug-migration",\
             .value    = "on",\
-        }
+        },
 
 #endif /* HW_COMPAT_H */
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 7ed43f1..7673a4d 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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",\
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 03/13] pc: Move commas inside PC_COMPAT_* macros
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 01/13] pc: Replace tab with spaces Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 02/13] hw: Move commas inside HW_COMPAT_2_1 macro Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 04/13] spapr: Move commas inside SPAPR_COMPAT_* macros Eduardo Habkost
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

Changing the convention to include commas inside the macros will allow
macros containing empty lists to be defined and used without compilation
errors.

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

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 0536056..cba341b 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -554,7 +554,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 */ }
     },
 };
@@ -566,7 +566,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 */ }
     },
 };
@@ -578,7 +578,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 */ }
     },
 };
@@ -588,7 +588,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 */ }
     },
 };
@@ -602,13 +602,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",\
@@ -625,20 +625,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",\
@@ -663,7 +663,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, \
@@ -673,13 +673,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",\
@@ -708,19 +708,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",\
@@ -737,13 +737,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",
@@ -756,14 +756,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",\
@@ -780,13 +780,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",
@@ -802,7 +802,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",\
@@ -811,7 +811,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, \
@@ -821,7 +821,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",
@@ -841,7 +841,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",\
@@ -862,13 +862,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",
@@ -884,7 +884,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",\
@@ -893,13 +893,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",
@@ -918,7 +918,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",
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 0248357..b308575 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -451,7 +451,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 */ }
     },
 };
@@ -463,7 +463,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 */ }
     },
 };
@@ -475,7 +475,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 */ }
     },
 };
@@ -485,7 +485,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 */ }
     },
 };
@@ -499,7 +499,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 */ }
     },
 };
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 7673a4d..ab862e3 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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"
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 04/13] spapr: Move commas inside SPAPR_COMPAT_* macros
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (2 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 03/13] pc: Move commas inside PC_COMPAT_* macros Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 05/13] hw: Define empty HW_COMPAT_2_[23] macros Eduardo Habkost
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

Changing the convention to include commas inside the macros will allow
macros containing empty lists to be defined and used without compilation
errors.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/ppc/spapr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5f67e17..baad70e 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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
@@ -1830,7 +1830,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 */ }
     };
 
@@ -1848,7 +1848,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);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 05/13] hw: Define empty HW_COMPAT_2_[23] macros
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (3 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 04/13] spapr: Move commas inside SPAPR_COMPAT_* macros Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 06/13] pc: Define PC_COMPAT_2_[123] macros Eduardo Habkost
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

Now we can make everything consistent and define the macros even if they
are still empty.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 include/hw/compat.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/hw/compat.h b/include/hw/compat.h
index c56a698..4a43466 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -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",\
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 06/13] pc: Define PC_COMPAT_2_[123] macros
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (4 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 05/13] hw: Define empty HW_COMPAT_2_[23] macros Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 07/13] spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros Eduardo Habkost
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

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 --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index cba341b..1d5b776 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -523,6 +523,10 @@ static QEMUMachine pc_i440fx_machine_v2_3 = {
     .alias = "pc",
     .init = pc_init_pci,
     .is_default = 1,
+    .compat_props = (GlobalProperty[]) {
+        PC_COMPAT_2_3
+        { /* end of list */ }
+    },
 };
 
 #define PC_I440FX_2_2_MACHINE_OPTIONS PC_I440FX_2_3_MACHINE_OPTIONS
@@ -531,6 +535,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                           \
@@ -542,7 +550,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 b308575..7b62fa6 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -420,6 +420,10 @@ static QEMUMachine pc_q35_machine_v2_3 = {
     .name = "pc-q35-2.3",
     .alias = "q35",
     .init = pc_q35_init,
+    .compat_props = (GlobalProperty[]) {
+        PC_COMPAT_2_3
+        { /* end of list */ }
+    },
 };
 
 #define PC_Q35_2_2_MACHINE_OPTIONS PC_Q35_2_3_MACHINE_OPTIONS
@@ -428,6 +432,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                      \
@@ -439,7 +447,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",\
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 07/13] spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (5 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 06/13] pc: Define PC_COMPAT_2_[123] macros Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 08/13] spapr: define SPAPR_COMPAT_2_3 Eduardo Habkost
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

SPAPR_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.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/ppc/spapr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index baad70e..84d1d81 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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,13 +1824,13 @@ static const TypeInfo spapr_machine_info = {
         },
 
 #define SPAPR_COMPAT_2_1 \
-        SPAPR_COMPAT_2_2
+        SPAPR_COMPAT_2_2 \
+        HW_COMPAT_2_1
 
 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 */ }
     };
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 08/13] spapr: define SPAPR_COMPAT_2_3
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (6 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 07/13] spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 09/13] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14 Eduardo Habkost
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

Don'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.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/ppc/spapr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 84d1d81..b5455a4 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -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,\
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 09/13] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (7 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 08/13] spapr: define SPAPR_COMPAT_2_3 Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 10/13] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11 Eduardo Habkost
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Alexander Graf, Michael S. Tsirkin

Those 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.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1d5b776..8a94dba 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -788,6 +788,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 = {
@@ -795,15 +803,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",
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 10/13] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (8 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 09/13] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14 Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 11/13] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13 Eduardo Habkost
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Alexander Graf, Michael S. Tsirkin

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.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 8a94dba..69539ee 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -900,6 +900,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 = {
@@ -907,15 +915,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",
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 11/13] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (9 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 10/13] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11 Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 12/13] piix: Move pc-0.1[23] rombar compat props " Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 13/13] pc_piix: Define PC_COMPAT_0_10 Eduardo Habkost
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: Aneesh Kumar K.V, Gerd Hoffmann, Alexander Graf,
	Michael S. Tsirkin

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 (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.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 69539ee..d09f01b 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -818,6 +818,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 \
@@ -830,10 +834,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),
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 12/13] piix: Move pc-0.1[23] rombar compat props to PC_COMPAT_0_13
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (10 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 11/13] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13 Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 13/13] pc_piix: Define PC_COMPAT_0_10 Eduardo Habkost
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Gerd Hoffmann, Alexander Graf, Michael S. Tsirkin

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.

Cc: Stefan Weil <sw@weilnetz.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index d09f01b..5182a9e 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -822,6 +822,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 \
@@ -833,15 +841,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",
@@ -876,15 +875,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",
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Qemu-devel] [PATCH 13/13] pc_piix: Define PC_COMPAT_0_10
  2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
                   ` (11 preceding siblings ...)
  2015-05-11 20:55 ` [Qemu-devel] [PATCH 12/13] piix: Move pc-0.1[23] rombar compat props " Eduardo Habkost
@ 2015-05-11 20:55 ` Eduardo Habkost
  12 siblings, 0 replies; 14+ messages in thread
From: Eduardo Habkost @ 2015-05-11 20:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Michael S. Tsirkin

Move compat_props from pc-0.10 to the macro, to make it consistent with
the other machines.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/i386/pc_piix.c | 47 +++++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 5182a9e..6e30eee 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -910,32 +910,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",
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-05-11 20:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-11 20:55 [Qemu-devel] [PATCH 00/13] pc, hw, spapr: Cleanup of {HW, PC, SPAPR}_COMPAT_* macros Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 01/13] pc: Replace tab with spaces Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 02/13] hw: Move commas inside HW_COMPAT_2_1 macro Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 03/13] pc: Move commas inside PC_COMPAT_* macros Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 04/13] spapr: Move commas inside SPAPR_COMPAT_* macros Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 05/13] hw: Define empty HW_COMPAT_2_[23] macros Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 06/13] pc: Define PC_COMPAT_2_[123] macros Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 07/13] spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 08/13] spapr: define SPAPR_COMPAT_2_3 Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 09/13] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14 Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 10/13] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11 Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 11/13] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13 Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 12/13] piix: Move pc-0.1[23] rombar compat props " Eduardo Habkost
2015-05-11 20:55 ` [Qemu-devel] [PATCH 13/13] pc_piix: Define PC_COMPAT_0_10 Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).