[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/15] kvm: x86: Catch and report failing IRQ and NM
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 10/15] kvm: x86: Catch and report failing IRQ and NMI injections |
Date: |
Mon, 7 Feb 2011 12:19:21 +0100 |
We do not need to abort, but the user should be notified that weird
things go on.
Signed-off-by: Jan Kiszka <address@hidden>
---
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 8668cb3..0aa0a41 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));
+ }
}
}
--
1.7.1
- [Qemu-devel] [PATCH 14/15] kvm: Make kvm_state globally available, (continued)
[Qemu-devel] [PATCH 05/15] Refactor debug and vmstop request interface, Jan Kiszka, 2011/02/07
[Qemu-devel] [PATCH 10/15] kvm: x86: Catch and report failing IRQ and NMI injections,
Jan Kiszka <=
[Qemu-devel] [PATCH 03/15] Fix a few coding style violations in cpus.c, Jan Kiszka, 2011/02/07
[Qemu-devel] [PATCH 01/15] Refactor kvm&tcg function names in cpus.c, Jan Kiszka, 2011/02/07
[Qemu-devel] [PATCH 08/15] kvm: x86: Prepare VCPU loop for in-kernel irqchip, Jan Kiszka, 2011/02/07
[Qemu-devel] [PATCH 09/15] kvm: Drop return values from kvm_arch_pre/post_run, Jan Kiszka, 2011/02/07
[Qemu-devel] [PATCH 04/15] Improve vm_stop reason declarations, Jan Kiszka, 2011/02/07