diff mbox

exit if we fail to initialize kvm

Message ID 1248814374-7953-1-git-send-email-glommer@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Glauber Costa July 28, 2009, 8:52 p.m. UTC
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.

But it will change when upstream accepts the --accel option.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 vl.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

Comments

Alexander Graf July 28, 2009, 9:12 p.m. UTC | #1
On 28.07.2009, at 22:52, Glauber Costa <glommer@redhat.com> 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.

Full ack. I have a patch for that in the suse version for some time  
now, because it really annoyed me.

Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf July 28, 2009, 9:15 p.m. UTC | #2
On 28.07.2009, at 22:52, Glauber Costa <glommer@redhat.com> 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.


Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Glauber Costa July 28, 2009, 9:28 p.m. UTC | #3
On Tue, Jul 28, 2009 at 11:15:19PM +0200, Alexander Graf wrote:
>
> On 28.07.2009, at 22:52, Glauber Costa <glommer@redhat.com> 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf July 28, 2009, 9:38 p.m. UTC | #4
On 28.07.2009, at 23:28, Glauber Costa <glommer@redhat.com> wrote:

> On Tue, Jul 28, 2009 at 11:15:19PM +0200, Alexander Graf wrote:
>>
>> On 28.07.2009, at 22:52, Glauber Costa <glommer@redhat.com> 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
>

Right, the difference is that instead of saying "initializing kvm  
failed" it would give the user some advice on what happened and what  
to do next.

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

Patch

diff --git a/vl.c b/vl.c
index 30c4ff9..cab62cb 100644
--- a/vl.c
+++ b/vl.c
@@ -5926,12 +5926,8 @@  int main(int argc, char **argv, char **envp)
 
         ret = kvm_init(smp_cpus);
         if (ret < 0) {
-#if defined(KVM_UPSTREAM) || defined(NO_CPU_EMULATION)
             fprintf(stderr, "failed to initialize KVM\n");
             exit(1);
-#endif
-            fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
-	     kvm_allowed = 0;
         }
     }