Patchwork [2/2] Use kvm32/kvm64 as default CPUs when running under KVM.

login
register
mail settings
Submitter Jes Sorensen
Date July 28, 2010, 12:42 p.m.
Message ID <1280320944-5560-3-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/60136/
State New
Headers show

Comments

Jes Sorensen - July 28, 2010, 12:42 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

KVM has a minimum CPU requirement in order to run, so there is no
reason to default to the very basic family 6, model 2 (or model 3 for
qemu32) CPU since the additional features are going to be available on
the host CPU.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 hw/pc.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 58dea57..b17a199 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -39,6 +39,7 @@ 
 #include "msix.h"
 #include "sysbus.h"
 #include "sysemu.h"
+#include "kvm.h"
 
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
@@ -866,11 +867,19 @@  void pc_cpus_init(const char *cpu_model)
 
     /* init CPUs */
     if (cpu_model == NULL) {
+        if (kvm_enabled()) {
 #ifdef TARGET_X86_64
-        cpu_model = "qemu64";
+            cpu_model = "kvm64";
 #else
-        cpu_model = "qemu32";
+            cpu_model = "kvm32";
 #endif
+        } else {
+#ifdef TARGET_X86_64
+            cpu_model = "qemu64";
+#else
+            cpu_model = "qemu32";
+#endif
+        }
     }
 
     for(i = 0; i < smp_cpus; i++) {