render / rpms / qemu

Forked from rpms/qemu 10 months ago
Clone

Blame 0001-qemu-kvm-Fix-default-machine-options.patch

91a090
From ad47ffe7134fc7cd6a74fd3cdc0470723b883b93 Mon Sep 17 00:00:00 2001
91a090
From: "Daniel P. Berrange" <berrange@redhat.com>
91a090
Date: Tue, 10 Jul 2012 10:54:55 +0100
91a090
Subject: [PATCH] qemu-kvm: Fix default machine options
91a090
91a090
qemu-kvm-specific machine defaults were missing for pc-0.15 to pc-1.1.
91a090
Then Daniel noted that --disable-kvm caused problems as the generated
91a090
binaries would be unable to run. As we are at it, we can drop the
91a090
kernel_irqchip=on that is now enable by default in upstream.
91a090
---
91a090
 hw/pc_piix.c |   23 ++++++++++++++++-------
91a090
 1 file changed, 16 insertions(+), 7 deletions(-)
91a090
91a090
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
91a090
index 98a06fa..5860d52 100644
91a090
--- a/hw/pc_piix.c
91a090
+++ b/hw/pc_piix.c
91a090
@@ -353,6 +353,12 @@ static void pc_xen_hvm_init(ram_addr_t ram_size,
91a090
 }
91a090
 #endif
91a090
 
91a090
+#ifdef CONFIG_KVM_OPTIONS
91a090
+#define KVM_MACHINE_OPTIONS "accel=kvm"
91a090
+#else
91a090
+#define KVM_MACHINE_OPTIONS ""
91a090
+#endif
91a090
+
91a090
 static QEMUMachine pc_machine_v1_2 = {
91a090
     .name = "pc-1.2",
91a090
     .alias = "pc",
91a090
@@ -360,7 +366,7 @@ static QEMUMachine pc_machine_v1_2 = {
91a090
     .init = pc_init_pci,
91a090
     .max_cpus = 255,
91a090
     .is_default = 1,
91a090
-    .default_machine_opts = "accel=kvm,kernel_irqchip=on",
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
 };
91a090
 
91a090
 #define PC_COMPAT_1_1 \
91a090
@@ -387,6 +393,7 @@ static QEMUMachine pc_machine_v1_1 = {
91a090
     .desc = "Standard PC",
91a090
     .init = pc_init_pci,
91a090
     .max_cpus = 255,
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_1_1,
91a090
         { /* end of list */ }
91a090
@@ -422,6 +429,7 @@ static QEMUMachine pc_machine_v1_0 = {
91a090
     .desc = "Standard PC",
91a090
     .init = pc_init_pci,
91a090
     .max_cpus = 255,
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_1_0,
91a090
         { /* end of list */ }
91a090
@@ -437,6 +445,7 @@ static QEMUMachine pc_machine_v0_15 = {
91a090
     .desc = "Standard PC",
91a090
     .init = pc_init_pci,
91a090
     .max_cpus = 255,
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_0_15,
91a090
         { /* end of list */ }
91a090
@@ -469,7 +478,7 @@ static QEMUMachine pc_machine_v0_14 = {
91a090
     .desc = "Standard PC",
91a090
     .init = pc_init_pci,
91a090
     .max_cpus = 255,
91a090
-    .default_machine_opts = "accel=kvm,kernel_irqchip=on",
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_0_14, 
91a090
         {
91a090
@@ -503,7 +512,7 @@ static QEMUMachine pc_machine_v0_13 = {
91a090
     .desc = "Standard PC",
91a090
     .init = pc_init_pci_no_kvmclock,
91a090
     .max_cpus = 255,
91a090
-    .default_machine_opts = "accel=kvm,kernel_irqchip=on",
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_0_13,
91a090
         {
91a090
@@ -541,7 +550,7 @@ static QEMUMachine pc_machine_v0_12 = {
91a090
     .desc = "Standard PC",
91a090
     .init = pc_init_pci_no_kvmclock,
91a090
     .max_cpus = 255,
91a090
-    .default_machine_opts = "accel=kvm,kernel_irqchip=on",
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_0_12,
91a090
         {
91a090
@@ -575,7 +584,7 @@ static QEMUMachine pc_machine_v0_11 = {
91a090
     .desc = "Standard PC, qemu 0.11",
91a090
     .init = pc_init_pci_no_kvmclock,
91a090
     .max_cpus = 255,
91a090
-    .default_machine_opts = "accel=kvm,kernel_irqchip=on",
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_0_11,
91a090
         {
91a090
@@ -597,7 +606,7 @@ static QEMUMachine pc_machine_v0_10 = {
91a090
     .desc = "Standard PC, qemu 0.10",
91a090
     .init = pc_init_pci_no_kvmclock,
91a090
     .max_cpus = 255,
91a090
-    .default_machine_opts = "accel=kvm,kernel_irqchip=on",
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         PC_COMPAT_0_11,
91a090
         {
91a090
@@ -631,7 +640,7 @@ static QEMUMachine isapc_machine = {
91a090
     .desc = "ISA-only PC",
91a090
     .init = pc_init_isa,
91a090
     .max_cpus = 1,
91a090
-    .default_machine_opts = "accel=kvm,kernel_irqchip=on",
91a090
+    .default_machine_opts = KVM_MACHINE_OPTIONS,
91a090
     .compat_props = (GlobalProperty[]) {
91a090
         {
91a090
             .driver   = "pc-sysfw",
91a090
-- 
91a090
1.7.10.4
91a090