]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commitdiff
Store MemoryRegion in RAMBlock
authorAvi Kivity <avi@redhat.com>
Wed, 21 Dec 2011 11:09:49 +0000 (13:09 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 4 Jan 2012 11:34:48 +0000 (13:34 +0200)
As a step in moving live migration from RAMBlocks to MemoryRegions,
store the MemoryRegion in a RAMBlock.

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
cpu-all.h
exec.c

index 734833abda16d4965d9adfaec901c71da601cc19..4acaa8bc41bca5602534e310e36fb71b9d88517d 100644 (file)
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -476,6 +476,7 @@ extern ram_addr_t ram_size;
 #define RAM_PREALLOC_MASK   (1 << 0)
 
 typedef struct RAMBlock {
+    struct MemoryRegion *mr;
     uint8_t *host;
     ram_addr_t offset;
     ram_addr_t length;
diff --git a/exec.c b/exec.c
index dffceb970cbd3eef9c1ea50a7dbc43b4e96e8430..a4116d91cf07cbf3f2b32797f02713be63085e19 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -2793,6 +2793,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host,
     size = TARGET_PAGE_ALIGN(size);
     new_block = g_malloc0(sizeof(*new_block));
 
+    new_block->mr = mr;
     new_block->offset = find_ram_offset(size);
     if (host) {
         new_block->host = host;