aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2012-10-17 16:13:12 -0600
committerMichael S. Tsirkin <mst@redhat.com>2012-10-29 17:59:06 +0200
commit05c0621e64b425d9f89bef542f0b85e61dc57ff8 (patch)
treed69ee408048c743333f79646486a9bb9a556a453 /hw/pci.c
parent2b199f9318ec698dfced65f5d4ad9729f166e37c (diff)
pci: Return PCI_INTX_DISABLED when no bus INTx routing support
Rather than assert, simply return PCI_INTX_DISABLED when we don't have a pci_route_irq_fn. PIIX already returns DISABLED for an invalid pin, so users already deal with this state. Users of this interface should only be acting on an ENABLED or INVERTED return value (though we really have no support for INVERTED). Also complain loudly when we hit this so we don't forget it's missing. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 8c6b3d19ae..70b5fd965b 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1117,7 +1117,13 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin)
pin = bus->map_irq(dev, pin);
dev = bus->parent_dev;
} while (dev);
- assert(bus->route_intx_to_irq);
+
+ if (!bus->route_intx_to_irq) {
+ error_report("PCI: Bug - unimplemented PCI INTx routing (%s)\n",
+ object_get_typename(OBJECT(bus->qbus.parent)));
+ return (PCIINTxRoute) { PCI_INTX_DISABLED, -1 };
+ }
+
return bus->route_intx_to_irq(bus->irq_opaque, pin);
}