From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdVE-0008JT-Jw for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkdVA-0008Fc-0I for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:16 -0500 Received: from mail-ia0-f173.google.com ([209.85.210.173]:53575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdV9-0008FX-O9 for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:11 -0500 Received: by mail-ia0-f173.google.com with SMTP id w21so5709644iac.4 for ; Mon, 17 Dec 2012 08:25:11 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 17 Dec 2012 17:24:38 +0100 Message-Id: <1355761490-10073-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> References: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 03/15] pci: clean up resetting of IRQs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, mst@redhat.com A PCI bus reset will deassert the INTX pins, and this will make the irq_count array all-zeroes. Check that this is the case, and remove the existing loop which might even unsync irq_count and irq_state. Signed-off-by: Paolo Bonzini --- hw/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 97a0cd7..ace9368 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -213,14 +213,14 @@ void pci_bus_reset(PCIBus *bus) { int i; - for (i = 0; i < bus->nirq; i++) { - bus->irq_count[i] = 0; - } for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) { if (bus->devices[i]) { pci_device_reset(bus->devices[i]); } } + for (i = 0; i < bus->nirq; i++) { + assert(bus->irq_count[i] == 0); + } } static int pcibus_reset(BusState *qbus) -- 1.8.0.2