Revision 73aaec4a kvm-all.c

b/kvm-all.c
815 815
}
816 816

  
817 817
#ifdef KVM_CAP_INTERNAL_ERROR_DATA
818
static void kvm_handle_internal_error(CPUState *env, struct kvm_run *run)
818
static int kvm_handle_internal_error(CPUState *env, struct kvm_run *run)
819 819
{
820 820

  
821 821
    if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) {
......
833 833
    if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION) {
834 834
        fprintf(stderr, "emulation failure\n");
835 835
        if (!kvm_arch_stop_on_emulation_error(env)) {
836
            return;
836
            return 0;
837 837
        }
838 838
    }
839 839
    /* FIXME: Should trigger a qmp message to let management know
840 840
     * something went wrong.
841 841
     */
842
    vm_stop(0);
842
    return -1;
843 843
}
844 844
#endif
845 845

  
......
967 967
            break;
968 968
        case KVM_EXIT_UNKNOWN:
969 969
            DPRINTF("kvm_exit_unknown\n");
970
            ret = -1;
970 971
            break;
971 972
        case KVM_EXIT_FAIL_ENTRY:
972 973
            DPRINTF("kvm_exit_fail_entry\n");
974
            ret = -1;
973 975
            break;
974 976
        case KVM_EXIT_EXCEPTION:
975 977
            DPRINTF("kvm_exit_exception\n");
978
            ret = -1;
976 979
            break;
977 980
#ifdef KVM_CAP_INTERNAL_ERROR_DATA
978 981
        case KVM_EXIT_INTERNAL_ERROR:
979
            kvm_handle_internal_error(env, run);
982
            ret = kvm_handle_internal_error(env, run);
980 983
            break;
981 984
#endif
982 985
        case KVM_EXIT_DEBUG:
......
997 1000
        }
998 1001
    } while (ret > 0);
999 1002

  
1003
    if (ret < 0) {
1004
        vm_stop(0);
1005
        env->exit_request = 1;
1006
    }
1000 1007
    if (env->exit_request) {
1001 1008
        env->exit_request = 0;
1002 1009
        env->exception_index = EXCP_INTERRUPT;

Also available in: Unified diff