]> git.proxmox.com Git - mirror_qemu.git/commit - memory.c
memory: allow destroying a non-empty MemoryRegion
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Oct 2015 08:59:50 +0000 (10:59 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 9 Oct 2015 13:25:56 +0000 (15:25 +0200)
commit2e2b8eb70fdb7dfbec39f3a19b20f9a73f2f813e
tree96c720cace8560394fffb7e7c9d5d3d30c5c4707
parentc6047e9621f77a65993bcda8f58b676996e24bb5
memory: allow destroying a non-empty MemoryRegion

This is legal; the MemoryRegion will simply unreference all the
existing subregions and possibly bring them down with it as well.
However, it requires a bit of care to avoid an infinite loop.
Finalizing a memory region cannot trigger an address space update,
but memory_region_del_subregion errs on the side of caution and
might trigger a spurious update: avoid that by resetting mr->enabled
first.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1443689999-12182-2-git-send-email-armbru@redhat.com>
memory.c