[PATCH 14/16] kvm: fix irq 0 assignment

Sheng Yang
2009-03-12T13:37:06Z

Shouldn't update assigned irq if host irq is 0, which means uninitialized
or don't support INTx.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
qemu/hw/device-assignment.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index 1cd4cf7..69f8e3a 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -590,6 +590,10 @@ static int assign_irq(AssignedDevInfo *adev)
AssignedDevice *dev = adev->assigned_dev;
int irq, r = 0;

+ /* IRQ PIN 0 means not use INTx */
+ if (pci_read_byte(dev->pdev, PCI_INTERRUPT_PIN) == 0)
+ return 0;
+
irq = pci_map_irq(&dev->dev, dev->intpin);
irq = piix_get_irq(irq);

--
1.5.4.5