mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
memory: convert memory_region_destroy to object_unparent
Explicitly call object_unparent in the few places where we will re-create the memory region. If the memory region is simply being destroyed as part of device teardown, let QOM handle it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e3fb0ade83
commit
d8d9581460
9 changed files with 18 additions and 14 deletions
|
@ -436,7 +436,7 @@ static void omap_gpmc_cs_unmap(struct omap_gpmc_s *s, int cs)
|
|||
}
|
||||
memory_region_del_subregion(get_system_memory(), &f->container);
|
||||
memory_region_del_subregion(&f->container, omap_gpmc_cs_memregion(s, cs));
|
||||
memory_region_destroy(&f->container);
|
||||
object_unparent(OBJECT(&f->container));
|
||||
}
|
||||
|
||||
void omap_gpmc_reset(struct omap_gpmc_s *s)
|
||||
|
|
|
@ -2266,7 +2266,7 @@ static void vfio_vga_quirk_teardown(VFIODevice *vdev)
|
|||
while (!QLIST_EMPTY(&vdev->vga.region[i].quirks)) {
|
||||
VFIOQuirk *quirk = QLIST_FIRST(&vdev->vga.region[i].quirks);
|
||||
memory_region_del_subregion(&vdev->vga.region[i].mem, &quirk->mem);
|
||||
memory_region_destroy(&quirk->mem);
|
||||
object_unparent(OBJECT(&quirk->mem));
|
||||
QLIST_REMOVE(quirk, next);
|
||||
g_free(quirk);
|
||||
}
|
||||
|
@ -2290,7 +2290,7 @@ static void vfio_bar_quirk_teardown(VFIODevice *vdev, int nr)
|
|||
while (!QLIST_EMPTY(&bar->quirks)) {
|
||||
VFIOQuirk *quirk = QLIST_FIRST(&bar->quirks);
|
||||
memory_region_del_subregion(&bar->mem, &quirk->mem);
|
||||
memory_region_destroy(&quirk->mem);
|
||||
object_unparent(OBJECT(&quirk->mem));
|
||||
QLIST_REMOVE(quirk, next);
|
||||
g_free(quirk);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue