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

net: notify peer about link status change



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

This works for virtio userspace, as qemu stops giving it packets, but
not for virtio-net connected to vhost-net as that does not get notified
about this change.

Notify peer when this happens, which will then be used by the follow-up
patch to stop/start vhost-net.

Note: it might be a good idea to make peer link status match tap in this
case, so the guest gets an event and updates the carrier state. For now
stay bug for bug compatible with what we used to have in userspace.
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 f45a1108
......@@ -1324,6 +1324,17 @@ done:
if (vc->info->link_status_changed) {
vc->info->link_status_changed(vc);
}
/* Notify peer. Don't update peer link status: this makes it possible to
* disconnect from host network without notifying the guest.
* FIXME: is disconnected link status change operation useful?
*
* Current behaviour is compatible with qemu vlans where there could be
* multiple clients that can still communicate with each other in
* disconnected mode. For now maintain this compatibility. */
if (vc->peer && vc->peer->info->link_status_changed) {
vc->peer->info->link_status_changed(vc->peer);
}
return 0;
}
......
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