Skip to content

Commit

Permalink
Store MemoryRegion in RAMBlock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
avikivity committed Jan 4, 2012
1 parent c5705a7 commit 7c63736
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpu-all.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7c63736

Please sign in to comment.