From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDfwd-0006Tc-HA for qemu-devel@nongnu.org; Mon, 08 Jun 2009 10:35:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDfwX-0006SL-Dc for qemu-devel@nongnu.org; Mon, 08 Jun 2009 10:35:25 -0400 Received: from [199.232.76.173] (port=46314 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDfwW-0006Ry-TB for qemu-devel@nongnu.org; Mon, 08 Jun 2009 10:35:21 -0400 Received: from mx2.redhat.com ([66.187.237.31]:36909) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MDfwW-0005VB-C4 for qemu-devel@nongnu.org; Mon, 08 Jun 2009 10:35:20 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n58EZHdM030724 for ; Mon, 8 Jun 2009 10:35:17 -0400 Message-ID: <4A2D219F.1020408@redhat.com> Date: Mon, 08 Jun 2009 17:35:11 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/3] Add pci_bus_reset() function. References: <1244465766-6349-1-git-send-email-gleb@redhat.com> <1244465766-6349-2-git-send-email-gleb@redhat.com> In-Reply-To: <1244465766-6349-2-git-send-email-gleb@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Yaniv Kamay , qemu-devel@nongnu.org Gleb Natapov wrote: > To reset internal irq handling data structures. > > Signed-off-by: Gleb Natapov > Signed-off-by: Yaniv Kamay > --- > 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)); > + } > +} > + > Shouldn't each device's reset function bring its line low, thus zeroing the irq_state naturally? If not, we have a bug somewhere. Note we have exactly the same issue with save/restore. -- error compiling committee.c: too many arguments to function