diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-02-07 12:19:21 +0100 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-02-14 12:39:46 -0200 |
commit | ce377af399563195d066d5fee0c7b717967932ee (patch) | |
tree | 9de1f19d970d95ce0748ec04edf6a79794b80267 /target-i386/kvm.c | |
parent | 7a39fe588251ba042c91bf23d53b0ba820bf964c (diff) |
kvm: x86: Catch and report failing IRQ and NMI injections
We do not need to abort, but the user should be notified that weird
things go on.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r-- | target-i386/kvm.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 8668cb3a97..0aa0a410da 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1442,11 +1442,17 @@ int kvm_arch_get_registers(CPUState *env) void kvm_arch_pre_run(CPUState *env, struct kvm_run *run) { + int ret; + /* Inject NMI */ if (env->interrupt_request & CPU_INTERRUPT_NMI) { env->interrupt_request &= ~CPU_INTERRUPT_NMI; DPRINTF("injected NMI\n"); - kvm_vcpu_ioctl(env, KVM_NMI); + ret = kvm_vcpu_ioctl(env, KVM_NMI); + if (ret < 0) { + fprintf(stderr, "KVM: injection failed, NMI lost (%s)\n", + strerror(-ret)); + } } if (!kvm_irqchip_in_kernel()) { @@ -1467,9 +1473,13 @@ void kvm_arch_pre_run(CPUState *env, struct kvm_run *run) struct kvm_interrupt intr; intr.irq = irq; - /* FIXME: errors */ DPRINTF("injected interrupt %d\n", irq); - kvm_vcpu_ioctl(env, KVM_INTERRUPT, &intr); + ret = kvm_vcpu_ioctl(env, KVM_INTERRUPT, &intr); + if (ret < 0) { + fprintf(stderr, + "KVM: injection failed, interrupt lost (%s)\n", + strerror(-ret)); + } } } |