[PATCH 0/2] libvhost-user: fix postcopy shared memory faults

Bin Guo <[email protected]>
Newsgroups gmane.comp.emulators.qemu
Message-ID <[email protected]>
These two independent bugs both sit on the libvhost-user postcopy path and
together make postcopy migration of a guest with a libvhost-user backend
fail.  They are only reachable when the backend negotiates
VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS, i.e. it adds memory regions one
by one with VHOST_USER_ADD_MEM_REG instead of VHOST_USER_SET_MEM_TABLE.

Patch 1 stops the backend from panicking on the "all postcopy client bases
received" ack, which QEMU sends as an fd-less VHOST_USER_ADD_MEM_REG.

Patch 2 makes the backend return its mapping address for a region added
that way, without which QEMU cannot translate the backend's fault
addresses back to a RAMBlock.

Reproduced and fixed with contrib/vhost-user-bridge as the net backend of
a postcopy migrated guest: before the series the destination backend
either panics or QEMU reports "Failed to find region for fault"; after it
the migration completes.

Bin Guo (2):
  libvhost-user: accept the postcopy client base ack in vu_add_mem_reg()
  libvhost-user: return the backend mapping address for added regions

 subprojects/libvhost-user/libvhost-user.c | 34 ++++++++++++++---------
 1 file changed, 21 insertions(+), 13 deletions(-)

-- 
2.50.1 (Apple Git-155)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.