diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-07 09:06:00 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-07-04 17:42:45 +0200 |
commit | 46637be269aaaceb9867ffdf176e906401138fff (patch) | |
tree | d4c5015e1ac35793959bef900fde1c0d8891cdaf /memory.c | |
parent | 803c0816a7d3ab35460991ba5b7d1fccc070332b (diff) | |
download | qemu-46637be269aaaceb9867ffdf176e906401138fff.tar.gz qemu-46637be269aaaceb9867ffdf176e906401138fff.tar.bz2 qemu-46637be269aaaceb9867ffdf176e906401138fff.zip |
memory: add ref/unref
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -1019,6 +1019,20 @@ Object *memory_region_owner(MemoryRegion *mr) return mr->owner; } +void memory_region_ref(MemoryRegion *mr) +{ + if (mr && mr->owner) { + object_ref(mr->owner); + } +} + +void memory_region_unref(MemoryRegion *mr) +{ + if (mr && mr->owner) { + object_unref(mr->owner); + } +} + uint64_t memory_region_size(MemoryRegion *mr) { if (int128_eq(mr->size, int128_2_64())) { |