summary refs log tree commit diff stats
path: root/memory.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-03-23 10:21:46 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-04-27 18:24:18 +0200
commit37d7c08413cd4307f53c83d43b1b06cf2701d7a7 (patch)
treefb4f93f730b5e8f8c3b0cca49f42090659327ab0 /memory.c
parente95205e1f9cd2c4262b7a7b1c992a94512c86d0e (diff)
downloadfocaccia-qemu-37d7c08413cd4307f53c83d43b1b06cf2701d7a7.tar.gz
focaccia-qemu-37d7c08413cd4307f53c83d43b1b06cf2701d7a7.zip
memory: add memory_region_ram_resize
This is a simple MemoryRegion wrapper for qemu_ram_resize.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index ee3f2a8a95..a11e9bf08a 100644
--- a/memory.c
+++ b/memory.c
@@ -1452,6 +1452,13 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr)
     return qemu_get_ram_ptr(mr->ram_addr & TARGET_PAGE_MASK);
 }
 
+void memory_region_ram_resize(MemoryRegion *mr, ram_addr_t newsize, Error **errp)
+{
+    assert(mr->terminates);
+
+    qemu_ram_resize(mr->ram_addr, newsize, errp);
+}
+
 static void memory_region_update_coalesced_range_as(MemoryRegion *mr, AddressSpace *as)
 {
     FlatView *view;