[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [patch 14/19] qemu: LSI SCSI and e1000 unregister callbacks
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [patch 14/19] qemu: LSI SCSI and e1000 unregister callbacks |
Date: |
Tue, 10 Feb 2009 18:31:05 -0200 |
User-agent: |
quilt/0.46-1 |
Signed-off-by: Marcelo Tosatti <address@hidden>
Index: trunk/hw/e1000.c
===================================================================
--- trunk.orig/hw/e1000.c
+++ trunk/hw/e1000.c
@@ -1034,6 +1034,16 @@ e1000_mmio_map(PCIDevice *pci_dev, int r
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 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd,
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;
}
Index: trunk/hw/lsi53c895a.c
===================================================================
--- trunk.orig/hw/lsi53c895a.c
+++ trunk/hw/lsi53c895a.c
@@ -1962,6 +1962,18 @@ void lsi_scsi_attach(void *opaque, Block
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 @@ void *lsi_scsi_init(PCIBus *bus, int dev
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);
--
- [Qemu-devel] [patch 04/19] qemu: dynamic nic info index allocation, (continued)
- [Qemu-devel] [patch 04/19] qemu: dynamic nic info index allocation, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 05/19] qemu: drive removal support, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 06/19] qemu: record devfn on block driver instance, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 07/19] qemu: move drives_opt for external use, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 09/19] qemu: add net_client_uninit / qemu_find_vlan_client, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 08/19] qemu: net/drive add/remove tweaks, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 10/19] qemu: add cpu_unregister_io_memory and make io mem table index dynamic, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 11/19] qemu: add qemu_free_irqs, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 12/19] qemu: add pci_unregister_device, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 13/19] qemu: warn if PCI region is not power of two, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 14/19] qemu: LSI SCSI and e1000 unregister callbacks,
Marcelo Tosatti <=
- [Qemu-devel] [patch 16/19] qemu: initialize hot add system / acpi gpe, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 15/19] qemu: zero ioport_opaque on isa_unassign_ioport, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 18/19] From: Markus Armbruster <address@hidden>, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 17/19] qemu: pci hotplug GPE support, Marcelo Tosatti, 2009/02/10
- [Qemu-devel] [patch 19/19] qemu: PCI device, disk and host network hot-add / hot-remove, Marcelo Tosatti, 2009/02/10
- Re: [Qemu-devel] [patch 00/19] acpi pci hotplug, Markus Armbruster, 2009/02/11
- [Qemu-devel] Re: [patch 00/19] acpi pci hotplug, Anthony Liguori, 2009/02/11