Patchwork [5/8] Convert ram_load() to the memory API

login
register
mail settings
Submitter Avi Kivity
Date Dec. 21, 2011, 1:34 p.m.
Message ID <1324474477-22267-6-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/132645/
State New
Headers show

Comments

Avi Kivity - Dec. 21, 2011, 1:34 p.m.
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch_init.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/arch_init.c b/arch_init.c
index 9b8a1f3..381c055 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -344,7 +344,7 @@  int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
             return NULL;
         }
 
-        return block->host + offset;
+        return memory_region_get_ram_ptr(block->mr) + offset;
     }
 
     len = qemu_get_byte(f);
@@ -353,7 +353,7 @@  int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque)
 
     QLIST_FOREACH(block, &ram_list.blocks, next) {
         if (!strncmp(id, block->idstr, sizeof(id)))
-            return block->host + offset;
+            return memory_region_get_ram_ptr(block->mr) + offset;
     }
 
     fprintf(stderr, "Can't find block %s!\n", id);