Re: [PATCH 08/28] kvm tools: Fix KVM_RUN exit code check

Alexander Graf
2011-12-07T06:44:40Z

On 07.12.2011, at 01:32, Matt Evans <matt@ozlabs.org> wrote:

> On 06/12/11 19:22, Sasha Levin wrote:
>> If KVM_RUN can actually return anything besides 0 or -1 it may be also
>> worthwhile to update Documentation/virtual/kvm/api.txt .
>>
>> What are the cases where it happens?
>
> Well, on PPC the internal kvmppc_run_vcpu() returns either RESUME_GUEST (which
> stays in-kernel and drops back to the guest) or RESUME_HOST, which is propagated
> back out to userland as the return value of ioctl(KVM_RUN). So, anything
> kvmtool sees is either <0 for error or RESUME_HOST, i.e. 2.
>
> Alex, do you think the PPC KVM code should be forced to 0 on success, or is
> there any value to the expanded the return codes (and updating api.txt) for
> varying kinds of positive success?

I don't think it's worth the potential ABI breakage to change the current behavior :). Even if we did change it, you would still have to touch kvm tool to work with older kernels.

Alex

>