diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-11 12:42:01 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-18 12:06:20 +0200 |
commit | d8d95814609e89e5438a3318a647ec322fc4ff16 (patch) | |
tree | a3f5cd4ff75d6488f0b00968cd7ed5c3a8df2c0b /hw/misc/vfio.c | |
parent | e3fb0ade83420a86464ee50c71f2daf5641cab10 (diff) |
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>
Diffstat (limited to 'hw/misc/vfio.c')
-rw-r--r-- | hw/misc/vfio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c index 0b9eba0c84..af9ae1fedf 100644 --- a/hw/misc/vfio.c +++ b/hw/misc/vfio.c @@ -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); } |