mirror of
https://github.com/qemu/qemu.git
synced 2026-09-21 22:14:32 +00:00
In postcopy mode the backend must tell QEMU where it mapped a region, so
that QEMU can translate the backend's fault addresses back into a RAMBlock
and offset. vu_add_mem_reg() works on a copy of the region and lets
_vu_add_mem_reg() fill the mapping address into that copy, but never writes
it back into the reply payload. QEMU then stores its own address as the
postcopy client base, so fault resolution fails:
vhost_user_postcopy_fault_handler: Failed to find region for fault ...
The VHOST_USER_SET_MEM_TABLE path is unaffected, it fills the payload
directly. Put the updated region back into the payload before replying; a
pointer into the payload cannot be used instead, as VhostUserMsg is packed.
Fixes: ec94c8e621 ("Support adding individual regions in libvhost-user")
Signed-off-by: Bin Guo <guobin@linux.alibaba.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260813095501.20282-3-guobin@linux.alibaba.com>