Skip to contentSkip to conversation

Fix default accelerator when configured with --disable-kvm

PATCH Applied Daniel P. Berrange 3 participants 3 messages Aug 5, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix default accelerator when configured with --disable-kvm

From: "Daniel P. Berrange" <[email protected]>

The default accelerator is hardcoded to 'kvm'. This is a fine default for qemu-kvm normally, but if the user built with ./configure --disable-kvm, then the resulting binaries will not work by default

* vl.c: Default to 'tcg' unless CONFIG_KVM is defined

---
 vl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
vl.c +5 -0
index 7ae549e..28fd2f3 100644
@@ -1953,8 +1953,13 @@ static int configure_accelerator(void)
     }
 
     if (p == NULL) {
+#ifdef CONFIG_KVM
         /* Use the default "accelerator", kvm */
         p = "kvm";
+#else
+        /* Use the default "accelerator", tcg */
+        p = "tcg";
+#endif
     }
 
     while (!accel_initalised && *p != '\0') {
Signature · 1 line
1.7.6
#1 lore raw
Quoted 10 lines · Daniel P. Berrange

From: "Daniel P. Berrange" <[email protected]>

The default accelerator is hardcoded to 'kvm'. This is a fine default for qemu-kvm normally, but if the user built with ./configure --disable-kvm, then the resulting binaries will not work by default

* vl.c: Default to 'tcg' unless CONFIG_KVM is defined

Applied, thanks.

#2 lore raw
Quoted 8 lines · Marcelo Tosatti
Quoted 7 lines · Daniel P. Berrange

From: "Daniel P. Berrange"<[email protected]>

The default accelerator is hardcoded to 'kvm'. This is a fine default for qemu-kvm normally, but if the user built with ./configure --disable-kvm, then the resulting binaries will not work by default

Quoted 5 lines
Quoted 3 lines

* vl.c: Default to 'tcg' unless CONFIG_KVM is defined

Applied, thanks.

FYI, you can now do the same thing by just patching sysconfig/target-x86_64.conf. I just modify my /usr/local/etc/qemu/target-x86_64.conf and now even with qemu.git, I get kvm enablement by default.

sysconfigs/target/target-x86_64.conf +2 -0
index 43ad282..2eabef9 100644
@@ -84,3 +84,5 @@
    xlevel = "0x80000008"
    model_id = "AMD Opteron 23xx (Gen 3 Class Opteron)"
 
+[machine]
+   accel = "kvm:tcg"

Regards,

Anthony Liguori

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html