[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 08/12] libvhost-user: enable it on any POSIX system
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 08/12] libvhost-user: enable it on any POSIX system |
Date: |
Wed, 8 May 2024 12:36:30 +0200 |
User-agent: |
Mozilla Thunderbird |
On 8/5/24 09:44, Stefano Garzarella wrote:
The vhost-user protocol is not really Linux-specific so let's enable
libvhost-user for any POSIX system.
Compiling it on macOS and FreeBSD some problems came up:
- avoid to include linux/vhost.h which is avaibale only on Linux
"available"
(vhost_types.h contains many of the things we need)
- macOS doesn't provide sys/endian.h, so let's define them
(note: libvhost-user doesn't include qemu's headers, so we can't use
"QEMU"
use "qemu/bswap.h")
- define eventfd_[write|read] as write/read wrapper when system doesn't
provide those (e.g. macOS)
- copy SEAL defines from include/qemu/memfd.h to make the code works
on FreeBSD where MFD_ALLOW_SEALING is defined
Alternatively add in subprojects/libvhost-user/include/osdep.h.
- define MAP_NORESERVE if it's not defined (e.g. on FreeBSD)
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
meson.build | 2 +-
subprojects/libvhost-user/libvhost-user.h | 2 +-
subprojects/libvhost-user/libvhost-user.c | 60 +++++++++++++++++++++--
3 files changed, 59 insertions(+), 5 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
- [PATCH v4 04/12] vhost-user-server: do not set memory fd non-blocking, (continued)
- [PATCH v4 04/12] vhost-user-server: do not set memory fd non-blocking, Stefano Garzarella, 2024/05/08
- [PATCH v4 05/12] contrib/vhost-user-blk: fix bind() using the right size of the address, Stefano Garzarella, 2024/05/08
- [PATCH v4 07/12] vhost-user: enable frontends on any POSIX system, Stefano Garzarella, 2024/05/08
- [PATCH v4 06/12] contrib/vhost-user-*: use QEMU bswap helper functions, Stefano Garzarella, 2024/05/08
- [PATCH v4 08/12] libvhost-user: enable it on any POSIX system, Stefano Garzarella, 2024/05/08
- Re: [PATCH v4 08/12] libvhost-user: enable it on any POSIX system,
Philippe Mathieu-Daudé <=
- [PATCH v4 09/12] contrib/vhost-user-blk: enable it on any POSIX system, Stefano Garzarella, 2024/05/08
- [PATCH v4 10/12] hostmem: add a new memory backend based on POSIX shm_open(), Stefano Garzarella, 2024/05/08
- [PATCH v4 12/12] tests/qtest/vhost-user-test: add a test case for memory-backend-shm, Stefano Garzarella, 2024/05/08