From e1113518ec4b649620a785870b1e37dd352f8b90 Mon Sep 17 00:00:00 2001
Message-Id: <e1113518ec4b649620a785870b1e37dd352f8b90.1355253494.git.minovotn@redhat.com>
From: Alon Levy <alevy@redhat.com>
Date: Mon, 10 Dec 2012 17:08:45 +0100
Subject: [PATCH 1/5] hw/pc: Correctly order compatibility props

RH-Author: Alon Levy <alevy@redhat.com>
Message-id: <1355159325-26392-1-git-send-email-alevy@redhat.com>
Patchwork-id: 44877
O-Subject: [PATCH] hw/pc: Correctly order compatibility props
Bugzilla: 733302
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>

machine->compat_props is registred in the qdev global prop list.
The compat properties are in reverse order - so for 6.2 qxl revision
property overrides 6.1's.

This patch reverses the order so PC_RHEL6_1_COMPAT overrides
PC_RHEL6_2_COMPAT etc.

Only qxl-vga.revision and qxl.revision are affected by this change, I
double checked (visually only though).

Note that this means the property list can contain multiple elements.
Since it's only used during initialization I think deduplication is not
worth the code.

upstream: no problem there.

RHBZ: 733302

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 hw/pc.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 hw/pc.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 443e1aa..2fe44b2 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1655,14 +1655,16 @@ static void rhel_common_init(const char *type1_version,
         }
 
 #define PC_RHEL6_2_COMPAT \
-        {\
+        PC_RHEL6_3_COMPAT \
+        ,{\
             .driver   = "virtio-net-pci",\
             .property = "x-__com_redhat_rhel620_compat",\
             .value    = "on",\
-        }, PC_RHEL6_3_COMPAT
+        }
 
 #define PC_RHEL6_1_COMPAT \
-        {\
+        PC_RHEL6_2_COMPAT \
+        ,{\
             .driver   = "usb-tablet",\
             .property = "migrate",\
             .value    = stringify(0),\
@@ -1706,14 +1708,15 @@ static void rhel_common_init(const char *type1_version,
             .driver   = "virtio-balloon",\
             .property = "event_idx",\
             .value    = "off",\
-        }, PC_RHEL6_2_COMPAT
+        }
 
 #define PC_RHEL6_0_COMPAT \
-        {\
+        PC_RHEL6_1_COMPAT \
+        ,{\
             .driver   = "virtio-serial-pci",\
             .property = "flow_control",\
             .value    = stringify(0),\
-        }, PC_RHEL6_1_COMPAT
+        }
 
 static void pc_rhel630_compat(void)
 {
-- 
1.7.11.7

