From: Pravin M Bathija <[email protected]>

This is version v2 of the patch and it incorporates the recommendations
made by AI code review.

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.

Also added Release notes as suggested by AI code review.

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 v2 (Current Version): Added release notes entry (review feedback)
Version v1: Initial patch

Pravin M Bathija (1):
  vhost: tolerate file descriptor in REM_MEM_REG msg

 doc/guides/rel_notes/release_26_07.rst | 8 ++++++++
 lib/vhost/vhost_user.c                 | 9 ++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

-- 
2.43.0

Reply via email to