summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/net/vhost_net.c2
-rw-r--r--net/vhost-user.c12
2 files changed, 12 insertions, 2 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 1ab4133769..840f443065 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -85,6 +85,8 @@ static const int user_feature_bits[] = {
VIRTIO_NET_F_CTRL_MAC_ADDR,
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS,
+ VIRTIO_NET_F_GUEST_ANNOUNCE,
+
VIRTIO_NET_F_MQ,
VHOST_INVALID_FEATURE_BIT
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 9b38431819..b067524f2b 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -103,6 +103,15 @@ err:
return -1;
}
+static ssize_t vhost_user_receive(NetClientState *nc, const uint8_t *buf,
+ size_t size)
+{
+ /* Discard the request that is received and managed by backend
+ * by an other way.
+ */
+ return size;
+}
+
static void vhost_user_cleanup(NetClientState *nc)
{
VhostUserState *s = DO_UPCAST(VhostUserState, nc, nc);
@@ -132,6 +141,7 @@ static bool vhost_user_has_ufo(NetClientState *nc)
static NetClientInfo net_vhost_user_info = {
.type = NET_CLIENT_OPTIONS_KIND_VHOST_USER,
.size = sizeof(VhostUserState),
+ .receive = vhost_user_receive,
.cleanup = vhost_user_cleanup,
.has_vnet_hdr = vhost_user_has_vnet_hdr,
.has_ufo = vhost_user_has_ufo,
@@ -182,8 +192,6 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
snprintf(nc->info_str, sizeof(nc->info_str), "vhost-user%d to %s",
i, chr->label);
- /* We don't provide a receive callback */
- nc->receive_disabled = 1;
nc->queue_index = i;
s = DO_UPCAST(VhostUserState, nc, nc);