9ae3a8
From 9b80afa6377ff6cb0f0f28ab3719ddb5b61e4193 Mon Sep 17 00:00:00 2001
9ae3a8
From: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Date: Mon, 20 Jan 2014 19:05:29 +0100
9ae3a8
Subject: [PATCH 32/34] pc: Create pc_compat_rhel*() functions
9ae3a8
9ae3a8
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
Message-id: <1390244730-31038-2-git-send-email-ehabkost@redhat.com>
9ae3a8
Patchwork-id: 56847
9ae3a8
O-Subject: [RHEL7 qemu-kvm PATCH 1/2] pc: Create pc_compat_rhel*() functions
9ae3a8
Bugzilla: 1049706
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Bandan Das <bsd@redhat.com>
9ae3a8
9ae3a8
Bugzilla: 1049706
9ae3a8
Brew scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=6900764
9ae3a8
Upstream status: not applicable
9ae3a8
9ae3a8
This is the RHEL equivalent of upstream
9ae3a8
commit 396f79f45ea75bd1c421522f29b4f91d490df7cc.
9ae3a8
9ae3a8
With the previous code, the compat code for a newer release could undo
9ae3a8
the compat changes made by the compat code for an older release. With
9ae3a8
the pc_init_*()/pc_compat_*() pattern, we can have two compat functions
9ae3a8
touching the same bits, as the older compat functions will run last,
9ae3a8
allowing it to undo changes done by newer compat functions.
9ae3a8
9ae3a8
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc_piix.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++---------
9ae3a8
 hw/i386/pc_q35.c  |  5 +++++
9ae3a8
 2 files changed, 55 insertions(+), 9 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 hw/i386/pc_piix.c |   59 ++++++++++++++++++++++++++++++++++++++++++++--------
9ae3a8
 hw/i386/pc_q35.c  |    5 ++++
9ae3a8
 2 files changed, 55 insertions(+), 9 deletions(-)
9ae3a8
9ae3a8
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
9ae3a8
index e061877..769571c 100644
9ae3a8
--- a/hw/i386/pc_piix.c
9ae3a8
+++ b/hw/i386/pc_piix.c
9ae3a8
@@ -743,8 +743,13 @@ machine_init(pc_machine_init);
9ae3a8
 
9ae3a8
 /* Red Hat Enterprise Linux machine types */
9ae3a8
 
9ae3a8
+static void pc_compat_rhel700(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+}
9ae3a8
+
9ae3a8
 static void pc_init_rhel700(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
+    pc_compat_rhel700(args);
9ae3a8
     pc_init_pci(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
@@ -868,8 +873,9 @@ static QEMUMachine pc_machine_rhel700 = {
9ae3a8
         .value    = "rhel6-virtio.rom",\
9ae3a8
     }
9ae3a8
 
9ae3a8
-static void pc_init_rhel650(QEMUMachineInitArgs *args)
9ae3a8
+static void pc_compat_rhel650(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
+    pc_compat_rhel700(args);
9ae3a8
     x86_cpu_compat_set_features("pentium", FEAT_1_EDX, 0, CPUID_APIC);
9ae3a8
     x86_cpu_compat_set_features("pentium2", FEAT_1_EDX, 0, CPUID_APIC);
9ae3a8
     x86_cpu_compat_set_features("pentium3", FEAT_1_EDX, 0, CPUID_APIC);
9ae3a8
@@ -911,7 +917,12 @@ static void pc_init_rhel650(QEMUMachineInitArgs *args)
9ae3a8
 
9ae3a8
     rom_file_in_ram = false; 
9ae3a8
     has_acpi_build = false;
9ae3a8
-    pc_init_rhel700(args);
9ae3a8
+}
9ae3a8
+
9ae3a8
+static void pc_init_rhel650(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+    pc_compat_rhel650(args);
9ae3a8
+    pc_init_pci(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static QEMUMachine pc_machine_rhel650 = {
9ae3a8
@@ -950,10 +961,16 @@ static QEMUMachine pc_machine_rhel650 = {
9ae3a8
         .value    = "off",\
9ae3a8
     }
9ae3a8
 
9ae3a8
-static void pc_init_rhel640(QEMUMachineInitArgs *args)
9ae3a8
+static void pc_compat_rhel640(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
+    pc_compat_rhel650(args);
9ae3a8
     x86_cpu_compat_set_features(NULL, FEAT_1_EDX, 0, CPUID_SEP);
9ae3a8
-    pc_init_rhel650(args);
9ae3a8
+}
9ae3a8
+
9ae3a8
+static void pc_init_rhel640(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+    pc_compat_rhel640(args);
9ae3a8
+    pc_init_pci(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static QEMUMachine pc_machine_rhel640 = {
9ae3a8
@@ -1016,13 +1033,19 @@ static QEMUMachine pc_machine_rhel640 = {
9ae3a8
         .value    = "1",\
9ae3a8
     }
9ae3a8
 
9ae3a8
-static void pc_init_rhel630(QEMUMachineInitArgs *args)
9ae3a8
+static void pc_compat_rhel630(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
+    pc_compat_rhel640(args);
9ae3a8
     disable_kvm_pv_eoi();
9ae3a8
     enable_compat_apic_id_mode();
9ae3a8
     x86_cpu_compat_set_features("SandyBridge", FEAT_1_ECX,
9ae3a8
                                 0, CPUID_EXT_TSC_DEADLINE_TIMER);
9ae3a8
-    pc_init_rhel640(args);
9ae3a8
+}
9ae3a8
+
9ae3a8
+static void pc_init_rhel630(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+    pc_compat_rhel630(args);
9ae3a8
+    pc_init_pci(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static QEMUMachine pc_machine_rhel630 = {
9ae3a8
@@ -1045,9 +1068,15 @@ static QEMUMachine pc_machine_rhel630 = {
9ae3a8
         .value = "off",\
9ae3a8
     }
9ae3a8
 
9ae3a8
+static void pc_compat_rhel620(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+    pc_compat_rhel630(args);
9ae3a8
+}
9ae3a8
+
9ae3a8
 static void pc_init_rhel620(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
-    pc_init_rhel630(args);
9ae3a8
+    pc_compat_rhel620(args);
9ae3a8
+    pc_init_pci(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static QEMUMachine pc_machine_rhel620 = {
9ae3a8
@@ -1111,9 +1140,15 @@ static QEMUMachine pc_machine_rhel620 = {
9ae3a8
         .value    = "1",\
9ae3a8
     }
9ae3a8
 
9ae3a8
+static void pc_compat_rhel610(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+    pc_compat_rhel620(args);
9ae3a8
+}
9ae3a8
+
9ae3a8
 static void pc_init_rhel610(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
-    pc_init_rhel620(args);
9ae3a8
+    pc_compat_rhel610(args);
9ae3a8
+    pc_init_pci(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static QEMUMachine pc_machine_rhel610 = {
9ae3a8
@@ -1144,9 +1179,15 @@ static QEMUMachine pc_machine_rhel610 = {
9ae3a8
         .value    = stringify(0),\
9ae3a8
     }
9ae3a8
 
9ae3a8
+static void pc_compat_rhel600(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+    pc_compat_rhel610(args);
9ae3a8
+}
9ae3a8
+
9ae3a8
 static void pc_init_rhel600(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
-    pc_init_rhel610(args);
9ae3a8
+    pc_compat_rhel600(args);
9ae3a8
+    pc_init_pci(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static QEMUMachine pc_machine_rhel600 = {
9ae3a8
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
9ae3a8
index 8d1a714..0280a95 100644
9ae3a8
--- a/hw/i386/pc_q35.c
9ae3a8
+++ b/hw/i386/pc_q35.c
9ae3a8
@@ -268,8 +268,13 @@ machine_init(pc_q35_machine_init);
9ae3a8
 
9ae3a8
 /* Red Hat Enterprise Linux machine types */
9ae3a8
 
9ae3a8
+static void pc_q35_compat_rhel700(QEMUMachineInitArgs *args)
9ae3a8
+{
9ae3a8
+}
9ae3a8
+
9ae3a8
 static void pc_q35_init_rhel700(QEMUMachineInitArgs *args)
9ae3a8
 {
9ae3a8
+    pc_q35_compat_rhel700(args);
9ae3a8
     pc_q35_init(args);
9ae3a8
 }
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8