summary refs log tree commit diff stats
path: root/hw/net
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-02-14 18:35:52 +0100
committerMichael S. Tsirkin <mst@redhat.com>2019-02-21 12:28:01 -0500
commitaf3bba761a1208c8515bcc72fc48d0f9045d040c (patch)
treeb1b41e2575bdd5b3d543142c0c2f8b4a3b619001 /hw/net
parentba28889838e6bdce540f30892d547cf634c1b0cd (diff)
downloadfocaccia-qemu-af3bba761a1208c8515bcc72fc48d0f9045d040c.tar.gz
focaccia-qemu-af3bba761a1208c8515bcc72fc48d0f9045d040c.zip
vhost-net: compile it on all targets that have virtio-net.
This shows a preexisting bug: if a KVM target did not have virtio-net enabled,
it would fail with undefined symbols when vhost was enabled.  This must now
be fixed, lest targets that have no virtio-net fail to compile.

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-5-git-send-email-pbonzini@redhat.com>
Message-Id: <1550165756-21617-6-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/net')
-rw-r--r--hw/net/Makefile.objs4
-rw-r--r--hw/net/vhost_net.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/hw/net/Makefile.objs b/hw/net/Makefile.objs
index acfaea5abf..ea63715780 100644
--- a/hw/net/Makefile.objs
+++ b/hw/net/Makefile.objs
@@ -37,8 +37,8 @@ obj-$(CONFIG_PSERIES) += spapr_llan.o
 obj-$(CONFIG_XILINX_ETHLITE) += xilinx_ethlite.o
 
 obj-$(CONFIG_VIRTIO_NET) += virtio-net.o
-obj-$(CONFIG_VHOST_NET) += vhost_net.o
-common-obj-$(call lnot,$(CONFIG_VHOST_NET)) += vhost_net-stub.o
+common-obj-$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET)) += vhost_net.o
+common-obj-$(call lnot,$(call land,$(CONFIG_VIRTIO_NET),$(CONFIG_VHOST_NET))) += vhost_net-stub.o
 common-obj-$(CONFIG_ALL) += vhost_net-stub.o
 
 obj-$(CONFIG_ETSEC) += fsl_etsec/etsec.o fsl_etsec/registers.o \
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index ae3ca23ac2..be3cc88370 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -25,8 +25,6 @@
 
 
 #include <sys/socket.h>
-#include <netpacket/packet.h>
-#include <net/ethernet.h>
 #include <net/if.h>
 #include <netinet/in.h>
 
@@ -134,7 +132,7 @@ static int vhost_net_get_fd(NetClientState *backend)
         return tap_get_fd(backend);
     default:
         fprintf(stderr, "vhost-net requires tap backend\n");
-        return -EBADFD;
+        return -ENOSYS;
     }
 }