diff options
author | Anthony PERARD | 2016-06-09 17:56:17 +0200 |
---|---|---|
committer | Stefano Stabellini | 2016-06-13 12:50:20 +0200 |
commit | d6b6aec4091a11e5429aac4d56ad0295c5316375 (patch) | |
tree | 3cc6285d6caa13429eb962b735dd18b522138907 | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160610-1' into st... (diff) | |
download | qemu-d6b6aec4091a11e5429aac4d56ad0295c5316375.tar.gz qemu-d6b6aec4091a11e5429aac4d56ad0295c5316375.tar.xz qemu-d6b6aec4091a11e5429aac4d56ad0295c5316375.zip |
exec: Fix qemu_ram_block_from_host for Xen
Since f615f39 (exec: remove ram_addr argument from
qemu_ram_block_from_host), migration under Xen is likely to fail, with a
SEGV of QEMU. But the commit only reveal a bug with the calculation of
the offset value in qemu_ram_block_from_host().
This patch calculates the offset from the ram_addr as
qemu_ram_addr_from_host() will later calculate the ram_addr from the
offset.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
-rw-r--r-- | exec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1935,7 +1935,7 @@ RAMBlock *qemu_ram_block_from_host(void *ptr, bool round_offset, ram_addr = xen_ram_addr_from_mapcache(ptr); block = qemu_get_ram_block(ram_addr); if (block) { - *offset = (host - block->host); + *offset = ram_addr - block->offset; } rcu_read_unlock(); return block; |