Re: [PATCH] 2/2: Fall back to plain Qemu if KVM is not present, report errors from libkvm

Avi Kivity
2006-11-14T13:55:58Z

Simon Kagstrom wrote:
>>>
>>>
>> Doesn't this bit will initialize kvm even if the user specified -no-kvm?
>>
>
> Yes. Maybe I misunderstood you, but this is how I understood your
> comments.
>
>

I intended something like

start with kvm_allowed = 1
if (-no-kvm) kvm_allowed = 0
if (kvm_allowed && !kvm_init() < 0) kvm_allowed = 0

> Sorry for spamming the list with patches. I'll send yet another
> one.

Keep on patching :)

> This will check and possibly disable KVM after the command-line
> options have been parsed. If -no-kvm has been given, nothing will
> happen.
>
>
>
> +#if USE_KVM
> + if (kvm_allowed) {
> + if (kvm_qemu_init() < 0) {
> + fprintf(stderr, "Could not initialize KVM, will disable KVM support\n");
> + kvm_allowed = 0;
> + }
> + }
> +#endif
> +
>

Yes, exactly what I meant.

I'll apply this. Thanks!

--
error compiling committee.c: too many arguments to function