To reset internal irq handling data structures.
Signed-off-by: Gleb Natapov <address@hidden>
Signed-off-by: Yaniv Kamay <address@hidden>
---
hw/pci.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 02b335f..89fefdf 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -88,6 +88,21 @@ static int pcibus_load(QEMUFile *f, void *opaque, int
version_id)
return 0;
}
+static void pci_bus_reset(void *opaque)
+{
+ PCIBus *bus = (PCIBus *)opaque;
+ int i;
+
+ for (i = 0; i < bus->nirq; i++) {
+ bus->irq_count[i] = 0;
+ }
+ for (i = 0; i < PCI_DEVICES_MAX; i++) {
+ if (bus->devices[i])
+ memset(bus->devices[i]->irq_state, 0,
+ sizeof(bus->devices[i]->irq_state));
+ }
+}
+