On Mon, Nov 09, 2026 at 10:55:42PM +0100, Simon Lucido wrote:
During postcopy, the vhost-user backend ought to return the base address
at which they mapped regions during SET_MEM_TABLE and ADD_MEM_REG calls
[0]. This was done properly for ADD_MEM_REG, but not for SET_MEM_TABLE,
so any frontend that was relying on that call would not work.

QEMU wasn't affected as it uses ADD_MEM_REG, but any combination of a
frontend that uses SET_MEM_TABLE and libvhost-user backend is.

[0]: 
https://gitlab.com/qemu-project/qemu/-/blob/144393da8d4bd307a22525c7feea2bb29a0a7556/docs/interop/vhost-user.rst#L1263

Fixes: d288eef3a0a8 ("libvhost-user: fix -Waddress-of-packed-member")

IMO the commit message should explain a bit better why that commit introduced the bug. I spent some time to understand the relationship, that IIUC is because from that commit we are using a local copy of VhostUserMemory.

The patch LGTM.

Thanks,
Stefano

Signed-off-by: Simon Lucido <[email protected]>
---
subprojects/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/subprojects/libvhost-user/libvhost-user.c 
b/subprojects/libvhost-user/libvhost-user.c
index 52817cc733d..df215810339 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -1119,6 +1119,7 @@ vu_set_mem_table_exec(VuDev *dev, VhostUserMsg *vmsg)

    if (dev->postcopy_listening) {
        /* Send the message back to qemu with the addresses filled in */
+        vmsg->payload.memory = m;
        vmsg->fd_num = 0;
        if (!vu_send_reply(dev, dev->sock, vmsg)) {
            vu_panic(dev, "failed to respond to set-mem-table for postcopy");

---
base-commit: 144393da8d4bd307a22525c7feea2bb29a0a7556
change-id: 20261109-setmemtable-fix-d9841f2d0eb7

Best regards,
--
Simon Lucido <[email protected]>



Reply via email to