Blob Blame History Raw
From 0bc3adc3b0a24625b1f8217abc1a50d7ce741191 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Fri, 2 Aug 2013 14:08:53 +0200
Subject: pc: set compat "pmu" property for rhel6.x machine-types

RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <1375452533-12507-4-git-send-email-ehabkost@redhat.com>
Patchwork-id: 52934
O-Subject: [RHEL-7 PATCH 3/3] pc: set compat "pmu" property for rhel6.x machine-types
Bugzilla: 853101
RH-Acked-by: Bandan Das <bsd@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Gleb Natapov <gleb@redhat.com>

Bugzilla: 853101
Upstream status: not applicable

This adds compatibility values to the rhel6.* machine-types for the
"pmu" property on X86CPU:

 * rhel6.2 and older doesn't have vPMU support
 * rhel6.3 has the broken passthrough-mode vPMU enabled
 * rhel6.4 and newer have vPMU disabled by default

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index e1bedec..bc67633 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -942,6 +942,10 @@ static QEMUMachine pc_machine_rhel640 = {
         .driver   = "virtio-scsi-pci",\
         .property = "param_change",\
         .value    = "off",\
+    },{\
+        .driver = TYPE_X86_CPU,\
+        .property = "pmu",\
+        .value = "on",\
     }
 
 static void pc_init_rhel630(QEMUMachineInitArgs *args)
@@ -964,7 +968,12 @@ static QEMUMachine pc_machine_rhel630 = {
 };
 
 #define PC_RHEL6_2_COMPAT \
-    PC_RHEL6_3_COMPAT
+    PC_RHEL6_3_COMPAT,\
+    {\
+        .driver = TYPE_X86_CPU,\
+        .property = "pmu",\
+        .value = "off",\
+    }
 
 static void pc_init_rhel620(QEMUMachineInitArgs *args)
 {