diff mbox

Use kvm32/kvm64 as default CPUs when running under KVM.

Message ID 1280311527-2650-1-git-send-email-Jes.Sorensen@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jes Sorensen July 28, 2010, 10:05 a.m. UTC
None
diff mbox

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++) {