diff options
author | Avi Kivity <avi@redhat.com> | 2012-10-07 12:59:55 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-10-22 14:50:08 +0200 |
commit | 83f3c251422b0724044f976a7ff26b2e8a47c374 (patch) | |
tree | ed5bdab5dd91f6e102eb228691c133485c0a8aa5 /exec.c | |
parent | b90600eed3c0efe5f3260853c873caf51c0677b1 (diff) | |
download | hqemu-83f3c251422b0724044f976a7ff26b2e8a47c374.zip hqemu-83f3c251422b0724044f976a7ff26b2e8a47c374.tar.gz |
memory: add address_space_destroy()
Since address spaces can be created dynamically by device hotplug, they
can also be destroyed dynamically.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -3234,6 +3234,16 @@ void address_space_init_dispatch(AddressSpace *as) memory_listener_register(&d->listener, as); } +void address_space_destroy_dispatch(AddressSpace *as) +{ + AddressSpaceDispatch *d = as->dispatch; + + memory_listener_unregister(&d->listener); + destroy_l2_mapping(&d->phys_map, P_L2_LEVELS - 1); + g_free(d); + as->dispatch = NULL; +} + static void memory_map_init(void) { system_memory = g_malloc(sizeof(*system_memory)); |