Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXGu2-0004MI-QK for qemu-devel@nongnu.org; Wed, 11 Feb 2009 10:21:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXGu2-0004LG-5a for qemu-devel@nongnu.org; Wed, 11 Feb 2009 10:21:30 -0500 Received: from [199.232.76.173] (port=52362 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXGu1-0004Ky-I5 for qemu-devel@nongnu.org; Wed, 11 Feb 2009 10:21:29 -0500 Received: from savannah.gnu.org ([199.232.41.3]:40309 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXGu1-0002H5-8P for qemu-devel@nongnu.org; Wed, 11 Feb 2009 10:21:29 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LXGtw-0004ss-3W for qemu-devel@nongnu.org; Wed, 11 Feb 2009 15:21:24 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LXGtv-0004so-BE for qemu-devel@nongnu.org; Wed, 11 Feb 2009 15:21:23 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Wed, 11 Feb 2009 15:21:23 +0000 Subject: [Qemu-devel] [6605] qemu: LSI SCSI and e1000 unregister callbacks (Marcelo Tosatti) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6605 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6605 Author: aliguori Date: 2009-02-11 15:21:22 +0000 (Wed, 11 Feb 2009) Log Message: ----------- qemu: LSI SCSI and e1000 unregister callbacks (Marcelo Tosatti) Signed-off-by: Marcelo Tosatti Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/e1000.c trunk/hw/lsi53c895a.c Modified: trunk/hw/e1000.c =================================================================== --- trunk/hw/e1000.c 2009-02-11 15:21:16 UTC (rev 6604) +++ trunk/hw/e1000.c 2009-02-11 15:21:22 UTC (rev 6605) @@ -1034,6 +1034,16 @@ excluded_regs[i] - 4); } +static int +pci_e1000_uninit(PCIDevice *dev) +{ + E1000State *d = (E1000State *) dev; + + cpu_unregister_io_memory(d->mmio_index); + + return 0; +} + PCIDevice * pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) { @@ -1092,6 +1102,7 @@ qemu_format_nic_info_str(d->vc, d->nd->macaddr); register_savevm(info_str, -1, 2, nic_save, nic_load, d); + d->dev.unregister = pci_e1000_uninit; return (PCIDevice *)d; } Modified: trunk/hw/lsi53c895a.c =================================================================== --- trunk/hw/lsi53c895a.c 2009-02-11 15:21:16 UTC (rev 6604) +++ trunk/hw/lsi53c895a.c 2009-02-11 15:21:22 UTC (rev 6605) @@ -1962,6 +1962,18 @@ bd->private = &s->pci_dev; } +static int lsi_scsi_uninit(PCIDevice *d) +{ + LSIState *s = (LSIState *) d; + + cpu_unregister_io_memory(s->mmio_io_addr); + cpu_unregister_io_memory(s->ram_io_addr); + + qemu_free(s->queue); + + return 0; +} + void *lsi_scsi_init(PCIBus *bus, int devfn) { LSIState *s; @@ -2004,6 +2016,7 @@ s->queue = qemu_malloc(sizeof(lsi_queue)); s->queue_len = 1; s->active_commands = 0; + s->pci_dev.unregister = lsi_scsi_uninit; lsi_soft_reset(s);