Re: [patch 2/3] kvm: handle internal error

Avi Kivity
2010-03-11T08:42:27Z

On 03/09/2010 03:53 AM, Marcelo Tosatti wrote:
> Port qemu-kvm's KVM_EXIT_INTERNAL_ERROR handling to upstream.
>
> Signed-off-by: Marcelo Tosatti<mtosatti@redhat.com>
>
> Index: qemu-kvm/kvm-all.c
> ===================================================================
> --- qemu-kvm.orig/kvm-all.c
> +++ qemu-kvm/kvm-all.c
> @@ -721,6 +721,28 @@ static int kvm_handle_io(uint16_t port,
> return 1;
> }
>
> +#ifdef KVM_CAP_INTERNAL_ERROR_DATA
> +static void kvm_handle_internal_error(CPUState *env, struct kvm_run *run)
> +{
> +
> + if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) {
> + int i;
> +
> + fprintf(stderr, "KVM internal error. Suberror: %d\n",
> + run->internal.suberror);
> +
> + for (i = 0; i< run->internal.ndata; ++i) {
> + fprintf(stderr, "extra data[%d]: %"PRIx64"\n",
> + i, (uint64_t)run->internal.data[i]);
> + }
> + }
> + cpu_dump_state(env, stderr, fprintf, 0);
> + if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION)
> + fprintf(stderr, "emulation failure\n");
>

{ braces }

> + vm_stop(0);
> +}
> +#endif
>

Should trigger a qmp message to let management know something went wrong
(can come later).

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