On Thu, Oct 22, 2026 at 03:47:29PM +0200, Tim Pambor wrote:
> The inflight fd code is guarded by #ifdef MFD_ALLOW_SEALING, which only
> tells us that the headers define the flag, not that memfd_create() is
> available in the C library. There are environments where the flag is
> defined but the link fails:
> 
>   ld: error: libvhost-user.a(libvhost-user.c.o): undefined symbol: 
> memfd_create
> 
> Probe for memfd_create() with MFD_ALLOW_SEALING in the subproject's
> meson.build, using the same test QEMU's top-level meson.build uses for
> CONFIG_MEMFD, and guard the code with CONFIG_MEMFD instead.
> 
> When memfd is not available, VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD is
> masked out as before, so the frontend never sends
> VHOST_USER_GET_INFLIGHT_FD.
> 
> Signed-off-by: Tim Pambor <[email protected]>
> ---
>  subprojects/libvhost-user/libvhost-user.c | 17 ++++++++---------
>  subprojects/libvhost-user/meson.build     | 11 ++++++++++-
>  2 files changed, 18 insertions(+), 10 deletions(-)

Should we move this commit before we enable libvhost-user on any POSIX?

Also, maybe we should do something similar for CONFIG_EVENTFD as I 
pointed out in the other commit.

Thanks,
Stefano


Reply via email to