[PATCH v3 0/1] vhost: tolerate fd in REM_MEM_REG for interop
pravin.bathija at dell.com
pravin.bathija at dell.com
Fri Jul 31 10:10:30 CEST 2026
From: Pravin M Bathija <pravin.bathija at dell.com>
This is version v3 of the patch and it incorporates the recommendations
made by David Marchand.
The VHOST_USER_REM_MEM_REG handler rejects messages carrying a file
descriptor, but the vhost-user specification allows back-ends to
accept one for compatibility with incorrect front-end implementations.
libblkio (v1.5.0) sends an fd with REM_MEM_REG because it shares a
message helper with ADD_MEM_REG. This causes DPDK to drop the
connection with:
expect 0 FDs for request VHOST_USER_REM_MEM_REG, received 1
QEMU's libvhost-user reference back-end already tolerates this.
The fix accepts the message and closes any unexpected fd without
using it, conforming to the specification's compatibility clause.
Tested with:
- QEMU VM bring-up with add/remove memory regions via monitor
- QEMU post-copy live migration between source and destination
- SPDK vhost-blk with libblkio fio engine (write + md5 verify)
- libblkio alloc-mem-region and map-mem-region unit tests
(ADD/REM/ADD cycles against SPDK vhost-blk)
Version Log:
Version v3 (Current version): Removed Release Notes entry as suggested by
David Marchand.
Version v2: Added release notes entry (review feedback).
Version v1: Initial patch.
Pravin M Bathija (1):
vhost: tolerate file descriptor in REM_MEM_REG msg
lib/vhost/vhost_user.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--
2.43.0
More information about the stable
mailing list