From: Alex Williamson Date: Wed, 17 Oct 2012 22:13:12 +0000 (-0600) Subject: pci: Return PCI_INTX_DISABLED when no bus INTx routing support X-Git-Tag: v1.3.0-rc0~140^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05c0621e64b425d9f89bef542f0b85e61dc57ff8;p=thirdparty%2Fqemu.git 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 Signed-off-by: Michael S. Tsirkin Acked-by: Jan Kiszka --- diff --git a/hw/pci.c b/hw/pci.c index 8c6b3d19ae0..70b5fd965b1 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); }