diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile.objs | 4 | ||||
-rw-r--r-- | net/net.c | 2 | ||||
-rw-r--r-- | net/vhost-user-stub.c | 23 |
3 files changed, 27 insertions, 2 deletions
diff --git a/net/Makefile.objs b/net/Makefile.objs index b2bf88a0ef..df2b409066 100644 --- a/net/Makefile.objs +++ b/net/Makefile.objs @@ -3,7 +3,9 @@ common-obj-y += socket.o common-obj-y += dump.o common-obj-y += eth.o common-obj-$(CONFIG_L2TPV3) += l2tpv3.o -common-obj-$(CONFIG_POSIX) += vhost-user.o +common-obj-$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET_USER)) += vhost-user.o +common-obj-$(call land,$(call lnot,$(CONFIG_VIRTIO_NET)),$(CONFIG_VHOST_NET_USER)) += vhost-user-stub.o +common-obj-$(CONFIG_ALL) += vhost-user-stub.o common-obj-$(CONFIG_SLIRP) += slirp.o common-obj-$(CONFIG_VDE) += vde.o common-obj-$(CONFIG_NETMAP) += netmap.o @@ -961,7 +961,7 @@ static int (* const net_client_init_fun[NET_CLIENT_DRIVER__MAX])( [NET_CLIENT_DRIVER_BRIDGE] = net_init_bridge, #endif [NET_CLIENT_DRIVER_HUBPORT] = net_init_hubport, -#ifdef CONFIG_VHOST_NET_USED +#ifdef CONFIG_VHOST_NET_USER [NET_CLIENT_DRIVER_VHOST_USER] = net_init_vhost_user, #endif #ifdef CONFIG_L2TPV3 diff --git a/net/vhost-user-stub.c b/net/vhost-user-stub.c new file mode 100644 index 0000000000..52ab4e13f1 --- /dev/null +++ b/net/vhost-user-stub.c @@ -0,0 +1,23 @@ +/* + * vhost-user-stub.c + * + * Copyright (c) 2018 Red Hat, Inc. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "qemu/osdep.h" +#include "clients.h" +#include "net/vhost_net.h" +#include "net/vhost-user.h" +#include "qemu/error-report.h" +#include "qapi/error.h" + +int net_init_vhost_user(const Netdev *netdev, const char *name, + NetClientState *peer, Error **errp) +{ + error_setg(errp, "vhost-user requires frontend driver virtio-net-*"); + return -1; +} |