Re: [PATCH] exit if we fail to initialize kvm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 28.07.2009, at 23:28, Glauber Costa wrote:

On Tue, Jul 28, 2009 at 11:15:19PM +0200, Alexander Graf wrote:

On 28.07.2009, at 22:52, Glauber Costa <glommer@xxxxxxxxxx> wrote:

Falling back to tcg has proven to be evil through time. The option is
to
do not try to act behind user's back, and quit the program completely
if
we fail to initialize kvm. Right now, the only way to run tcg from our
tree
becomes explicitly asking for it, with the -no-kvm option.

Well, actually there's one little difference: I tell the user to use -
no-kvm if he really wants cpu emulation.

But simply failing is probably good enough.
With my patch, we won't fail if the user asked -no-kvm, because then we won't
even try to initialize kvm.

We only exit here, if we try, but fail

This is the patch as I had it in kvm-86. It's really only about being helpful to the user.

Index: kvm-86/vl.c
===================================================================
--- kvm-86.orig/vl.c
+++ kvm-86/vl.c
@@ -5836,7 +5836,8 @@ int main(int argc, char **argv, char **e
 #ifdef USE_KVM
     if (kvm_enabled()) {
 	if (kvm_qemu_init() < 0) {
- fprintf(stderr, "Could not initialize KVM, will disable KVM support\n"); + fprintf(stderr, "Could not initialize KVM. Do you have kvm-amd or kvm-intel modprobe'd?\nIf you want to use CPU emulation, start with -no-kvm.\n");
+	    exit(1);
 #ifdef NO_CPU_EMULATION
fprintf(stderr, "Compiled with --disable-cpu-emulation, exiting. \n");
 	    exit(1);


Alex

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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux