qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/8] Store MemoryRegion in RAMBlock


From: Avi Kivity
Subject: [Qemu-devel] [PATCH 1/8] Store MemoryRegion in RAMBlock
Date: Wed, 21 Dec 2011 15:34:30 +0200

As a step in moving live migration from RAMBlocks to MemoryRegions,
store the MemoryRegion in a RAMBlock.

Signed-off-by: Avi Kivity <address@hidden>
---
 cpu-all.h |    1 +
 exec.c    |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/cpu-all.h b/cpu-all.h
index 734833a..4acaa8b 100644
--- 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 dffceb9..a4116d9 100644
--- 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;
-- 
1.7.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]