mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-30 21:42:06 -06:00
qemu: LSI SCSI and e1000 unregister callbacks (Marcelo Tosatti)
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6605 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
a4c20c6a54
commit
4b09be85a0
2 changed files with 24 additions and 0 deletions
11
hw/e1000.c
11
hw/e1000.c
|
@ -1034,6 +1034,16 @@ e1000_mmio_map(PCIDevice *pci_dev, int region_num,
|
||||||
excluded_regs[i] - 4);
|
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 *
|
PCIDevice *
|
||||||
pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
|
pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
|
||||||
{
|
{
|
||||||
|
@ -1092,6 +1102,7 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn)
|
||||||
qemu_format_nic_info_str(d->vc, d->nd->macaddr);
|
qemu_format_nic_info_str(d->vc, d->nd->macaddr);
|
||||||
|
|
||||||
register_savevm(info_str, -1, 2, nic_save, nic_load, d);
|
register_savevm(info_str, -1, 2, nic_save, nic_load, d);
|
||||||
|
d->dev.unregister = pci_e1000_uninit;
|
||||||
|
|
||||||
return (PCIDevice *)d;
|
return (PCIDevice *)d;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1962,6 +1962,18 @@ void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id)
|
||||||
bd->private = &s->pci_dev;
|
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)
|
void *lsi_scsi_init(PCIBus *bus, int devfn)
|
||||||
{
|
{
|
||||||
LSIState *s;
|
LSIState *s;
|
||||||
|
@ -2004,6 +2016,7 @@ void *lsi_scsi_init(PCIBus *bus, int devfn)
|
||||||
s->queue = qemu_malloc(sizeof(lsi_queue));
|
s->queue = qemu_malloc(sizeof(lsi_queue));
|
||||||
s->queue_len = 1;
|
s->queue_len = 1;
|
||||||
s->active_commands = 0;
|
s->active_commands = 0;
|
||||||
|
s->pci_dev.unregister = lsi_scsi_uninit;
|
||||||
|
|
||||||
lsi_soft_reset(s);
|
lsi_soft_reset(s);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue