@@ -151,7 +151,6 @@ have_tpm = get_option('tpm') \
# vhost
have_vhost_user = get_option('vhost_user') \
- .disable_auto_if(host_os != 'linux') \
.require(host_os != 'windows',
error_message: 'vhost-user is not available on Windows').allowed()
have_vhost_vdpa = get_option('vhost_vdpa') \
@@ -34,8 +34,14 @@
#include "standard-headers/linux/virtio_ring.h"
#include "hw/virtio/vhost.h"
#include "hw/virtio/virtio-bus.h"
-#include "linux-headers/linux/vhost.h"
+#if defined(__linux__)
+#include "linux-headers/linux/vhost.h"
+#else
+#ifndef VHOST_FILE_UNBIND
+#define VHOST_FILE_UNBIND -1
+#endif
+#endif
/* Features supported by host kernel. */
static const int kernel_feature_bits[] = {
@@ -40,7 +40,7 @@ config VHOST_USER_BLK
bool
# Only PCI devices are provided for now
default y if VIRTIO_PCI
- depends on VIRTIO && VHOST_USER && LINUX
+ depends on VIRTIO && VHOST_USER
config SWIM
bool
The vhost-user protocol is not really Linux-specific so let's enable vhost-user frontends for any POSIX system. In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux specific header, let's define it for other systems as well. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> --- If we want to be more conservative, maybe we can leave `have_vhost_user` auto only on linux. I removed it more to test with CI if we have any problems in the other POSIX systems. In hw/net/vhost_net.c maybe we can just do: #ifndef VHOST_FILE_UNBIND #define VHOST_FILE_UNBIND -1 #endif Any suggestion? Thanks, Stefano --- meson.build | 1 - hw/net/vhost_net.c | 8 +++++++- hw/block/Kconfig | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-)