aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-backend.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-02-14 18:35:53 +0100
committerMichael S. Tsirkin <mst@redhat.com>2019-02-21 12:28:01 -0500
commit299e6f19b3e285f3ab00b780e3b48f5e58b5d4ed (patch)
tree8f8aab219b0cbd50d1dcbcad4cb14ad2555c6617 /hw/virtio/vhost-backend.c
parentaf3bba761a1208c8515bcc72fc48d0f9045d040c (diff)
vhost-net: revamp configure logic
Detect all invalid configurations (e.g. mingw32 with vhost-user, non-Linux with vhost-kernel). As a collateral benefit, all vhost-kernel backends can be now disabled if one wants to reduce the attack surface. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1543851204-41186-6-git-send-email-pbonzini@redhat.com> Message-Id: <1550165756-21617-7-git-send-email-pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/vhost-backend.c')
-rw-r--r--hw/virtio/vhost-backend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
index e0f0bb7cb4..96b8d3c95d 100644
--- a/hw/virtio/vhost-backend.c
+++ b/hw/virtio/vhost-backend.c
@@ -14,7 +14,7 @@
#include "qemu/error-report.h"
#include "standard-headers/linux/vhost_types.h"
-#ifdef CONFIG_LINUX
+#ifdef CONFIG_VHOST_KERNEL
#include <linux/vhost.h>
#include <sys/ioctl.h>
@@ -275,7 +275,7 @@ int vhost_set_backend_type(struct vhost_dev *dev, VhostBackendType backend_type)
int r = 0;
switch (backend_type) {
-#ifdef CONFIG_LINUX
+#ifdef CONFIG_VHOST_KERNEL
case VHOST_BACKEND_TYPE_KERNEL:
dev->vhost_ops = &kernel_ops;
break;