diff mbox

[stable-0.15,5/6] pci-assign: Update legacy interrupts only if used

Message ID 1349806133-1916-6-git-send-email-afaerber@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Andreas Färber Oct. 9, 2012, 6:08 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Don't mess with assign_intx on devices that are in MSI or MSI-X mode, it
would corrupt their interrupt routing.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
(cherry picked from commit 096392efe1e5ee670f880c96c31f7ea8d6d76cf4)

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/device-assignment.c |    9 ++++++---
 1 Datei geändert, 6 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)
diff mbox

Patch

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index d586ce4..43029a4 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1062,9 +1062,12 @@  void assigned_dev_update_irqs(void)
     dev = QLIST_FIRST(&devs);
     while (dev) {
         next = QLIST_NEXT(dev, next);
-        r = assign_irq(dev);
-        if (r < 0)
-            qdev_unplug(&dev->dev.qdev);
+        if (dev->irq_requested_type & KVM_DEV_IRQ_HOST_INTX) {
+            r = assign_irq(dev);
+            if (r < 0) {
+                qdev_unplug(&dev->dev.qdev);
+            }
+        }
         dev = next;
     }
 }