diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2017-09-21 18:51:08 +1000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-09-22 01:06:51 +0200 |
commit | b516572f31c0ea0937cd9d11d9bd72dd83809886 (patch) | |
tree | d056ca608f5ebee44b3aad58fc1e7695de14a6f4 /memory.c | |
parent | 5e8fd947e2670c3c18f139de6a83fafcb56abbcc (diff) | |
download | qemu-b516572f31c0ea0937cd9d11d9bd72dd83809886.zip qemu-b516572f31c0ea0937cd9d11d9bd72dd83809886.tar.gz qemu-b516572f31c0ea0937cd9d11d9bd72dd83809886.tar.bz2 |
memory: Get rid of address_space_init_shareable
Since FlatViews are shared now and ASes not, this gets rid of
address_space_init_shareable().
This should cause no behavioural change.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-Id: <20170921085110.25598-17-aik@ozlabs.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -2722,9 +2722,7 @@ void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name) { memory_region_ref(root); memory_region_transaction_begin(); - as->ref_count = 1; as->root = root; - as->malloced = false; as->current_map = NULL; as->ioeventfd_nb = 0; as->ioeventfds = NULL; @@ -2737,37 +2735,18 @@ void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name) static void do_address_space_destroy(AddressSpace *as) { - bool do_free = as->malloced; - assert(QTAILQ_EMPTY(&as->listeners)); flatview_unref(as->current_map); g_free(as->name); g_free(as->ioeventfds); memory_region_unref(as->root); - if (do_free) { - g_free(as); - } -} - -AddressSpace *address_space_init_shareable(MemoryRegion *root, const char *name) -{ - AddressSpace *as; - - as = g_malloc0(sizeof *as); - address_space_init(as, root, name); - as->malloced = true; - return as; } void address_space_destroy(AddressSpace *as) { MemoryRegion *root = as->root; - as->ref_count--; - if (as->ref_count) { - return; - } /* Flush out anything from MemoryListeners listening in on this */ memory_region_transaction_begin(); as->root = NULL; |