Commit 32993698 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Aurelien Jarno
Browse files

vhost: disable on tap link down



qemu makes it possible to disable link at tap which is not communicated
to the guest but causes all packets to be dropped.

When vhost-net is enabled, vhost needs to be aware of both the virtio
link_down and the peer link_down. we switch to userspace emulation when
either is down.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reported-by: default avatarpradeep <psuriset@linux.vnet.ibm.com>
Acked-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
parent ab1cbe1c
......@@ -115,7 +115,8 @@ static void virtio_net_vhost_status(VirtIONet *n, uint8_t status)
if (!tap_get_vhost_net(n->nic->nc.peer)) {
return;
}
if (!!n->vhost_started == virtio_net_started(n, status)) {
if (!!n->vhost_started == virtio_net_started(n, status) &&
!n->nic->nc.peer->link_down) {
return;
}
if (!n->vhost_started) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment