Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>
Index: kvm-userspace.hotplug2/qemu/hw/lsi53c895a.c
===================================================================
--- kvm-userspace.hotplug2.orig/qemu/hw/lsi53c895a.c
+++ kvm-userspace.hotplug2/qemu/hw/lsi53c895a.c
@@ -1849,6 +1849,18 @@ void lsi_scsi_attach(void *opaque, Block
bd->devfn = s->pci_dev.devfn;
}
+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;
@@ -1881,6 +1893,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);
Index: kvm-userspace.hotplug2/qemu/hw/e1000.c
===================================================================
--- kvm-userspace.hotplug2.orig/qemu/hw/e1000.c
+++ kvm-userspace.hotplug2/qemu/hw/e1000.c
@@ -930,6 +930,16 @@ e1000_mmio_map(PCIDevice *pci_dev, int r
cpu_register_physical_memory(addr, PNPMMIO_SIZE, d->mmio_index);
}
+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)
{
@@ -994,6 +1004,7 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd,
d->nd->macaddr[3], d->nd->macaddr[4], d->nd->macaddr[5]);
register_savevm(info_str, d->instance, 1, nic_save, nic_load, d);
+ d->dev.unregister = pci_e1000_uninit;
return (PCIDevice *)d;
}
--
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel