summaryrefslogtreecommitdiff
path: root/migration/savevm.c
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2016-05-10 10:04:59 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2016-05-23 16:53:44 +0200
commitfa53a0e53efdc7002497ea4a76aacf6cceb170ef (patch)
treeea02755b801884f1043e0eaa4127205a2bcee370 /migration/savevm.c
parente92a2d9cb3d8f589c9fe5d2eacc83d8dddea0e16 (diff)
downloadqemu-fa53a0e53efdc7002497ea4a76aacf6cceb170ef.tar.gz
memory: drop find_ram_block()
On the one hand, we have already qemu_get_ram_block() whose function is similar. On the other hand, we can directly use mr->ram_block but searching RAMblock by ram_addr which is a kind of waste. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-Id: <1462845901-89716-2-git-send-email-arei.gonglei@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'migration/savevm.c')
-rw-r--r--migration/savevm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index bfb3d9178f..9bc362a1d3 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2229,13 +2229,13 @@ void hmp_info_snapshots(Monitor *mon, const QDict *qdict)
void vmstate_register_ram(MemoryRegion *mr, DeviceState *dev)
{
- qemu_ram_set_idstr(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK,
+ qemu_ram_set_idstr(mr->ram_block,
memory_region_name(mr), dev);
}
void vmstate_unregister_ram(MemoryRegion *mr, DeviceState *dev)
{
- qemu_ram_unset_idstr(memory_region_get_ram_addr(mr) & TARGET_PAGE_MASK);
+ qemu_ram_unset_idstr(mr->ram_block);
}
void vmstate_register_ram_global(MemoryRegion *mr)