Commit 4b09be85a08c601cf2f25f799ab6f4c51c165e0a
1 parent
a4c20c6a
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
Showing
2 changed files
with
24 additions
and
0 deletions
hw/e1000.c
| ... | ... | @@ -1034,6 +1034,16 @@ e1000_mmio_map(PCIDevice *pci_dev, int region_num, |
| 1034 | 1034 | excluded_regs[i] - 4); |
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | +static int | |
| 1038 | +pci_e1000_uninit(PCIDevice *dev) | |
| 1039 | +{ | |
| 1040 | + E1000State *d = (E1000State *) dev; | |
| 1041 | + | |
| 1042 | + cpu_unregister_io_memory(d->mmio_index); | |
| 1043 | + | |
| 1044 | + return 0; | |
| 1045 | +} | |
| 1046 | + | |
| 1037 | 1047 | PCIDevice * |
| 1038 | 1048 | pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) |
| 1039 | 1049 | { |
| ... | ... | @@ -1092,6 +1102,7 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) |
| 1092 | 1102 | qemu_format_nic_info_str(d->vc, d->nd->macaddr); |
| 1093 | 1103 | |
| 1094 | 1104 | register_savevm(info_str, -1, 2, nic_save, nic_load, d); |
| 1105 | + d->dev.unregister = pci_e1000_uninit; | |
| 1095 | 1106 | |
| 1096 | 1107 | return (PCIDevice *)d; |
| 1097 | 1108 | } | ... | ... |
hw/lsi53c895a.c
| ... | ... | @@ -1962,6 +1962,18 @@ void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id) |
| 1962 | 1962 | bd->private = &s->pci_dev; |
| 1963 | 1963 | } |
| 1964 | 1964 | |
| 1965 | +static int lsi_scsi_uninit(PCIDevice *d) | |
| 1966 | +{ | |
| 1967 | + LSIState *s = (LSIState *) d; | |
| 1968 | + | |
| 1969 | + cpu_unregister_io_memory(s->mmio_io_addr); | |
| 1970 | + cpu_unregister_io_memory(s->ram_io_addr); | |
| 1971 | + | |
| 1972 | + qemu_free(s->queue); | |
| 1973 | + | |
| 1974 | + return 0; | |
| 1975 | +} | |
| 1976 | + | |
| 1965 | 1977 | void *lsi_scsi_init(PCIBus *bus, int devfn) |
| 1966 | 1978 | { |
| 1967 | 1979 | LSIState *s; |
| ... | ... | @@ -2004,6 +2016,7 @@ void *lsi_scsi_init(PCIBus *bus, int devfn) |
| 2004 | 2016 | s->queue = qemu_malloc(sizeof(lsi_queue)); |
| 2005 | 2017 | s->queue_len = 1; |
| 2006 | 2018 | s->active_commands = 0; |
| 2019 | + s->pci_dev.unregister = lsi_scsi_uninit; | |
| 2007 | 2020 | |
| 2008 | 2021 | lsi_soft_reset(s); |
| 2009 | 2022 | ... | ... |