/* Trigger pci bus reset under a given bus. Called via qbus_reset_all on RST# assert, after the devices have been reset qdev_reset_all-ed already.  */
static void pcibus_reset(BusState *qbus)
/* Trigger pci bus reset under a given bus. Called via qbus_reset_all on RST# assert, after the devices have been reset qdev_reset_all-ed already.  */
static void pcibus_reset(BusState *qbus)
{
    PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus);
    int i;
    for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {
        if (bus->devices[i]) {
            pci_do_device_reset(bus->devices[i]);
        }
    }
    for (i = 0; i < bus->nirq; i++) {
        assert(bus->irq_count[i] == 0);
    }
}