diff mbox

[07/13] pci-assign: Fix kvm_deassign_irq handling in assign_irq

Message ID d9c3229c6c21bd57f1afe8457a60d613c557b418.1309198794.git.jan.kiszka@web.de (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka June 27, 2011, 6:19 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Always clear AssignedDevice::irq_requested_type after calling
kvm_deassign_irq. Moreover, drop the obviously incorrect exclusion when
reporting related errors - if irq_requested_type is non-zero, deassign
must not fail.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/device-assignment.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 36ad6b0..36c0f5f 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -992,9 +992,10 @@  static int assign_irq(AssignedDevice *dev)
     if (dev->irq_requested_type) {
         assigned_irq_data.flags = dev->irq_requested_type;
         r = kvm_deassign_irq(kvm_state, &assigned_irq_data);
-        /* -ENXIO means no assigned irq */
-        if (r && r != -ENXIO)
+        if (r) {
             perror("assign_irq: deassign");
+        }
+        dev->irq_requested_type = 0;
     }
 
     assigned_irq_data.flags = KVM_DEV_IRQ_GUEST_INTX;