[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/2] exec: Fix qemu_ram_block_from_host for Xen
From: |
Stefano Stabellini |
Subject: |
[Qemu-devel] [PULL 1/2] exec: Fix qemu_ram_block_from_host for Xen |
Date: |
Mon, 13 Jun 2016 11:57:06 +0100 |
From: Anthony PERARD <address@hidden>
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 <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Stefano Stabellini <address@hidden>
---
exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/exec.c b/exec.c
index a9d465b..4f3818c 100644
--- a/exec.c
+++ b/exec.c
@@ -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;
--
1.9.1