Commit 85965487 authored by Stefano Garzarella's avatar Stefano Garzarella Committed by David S. Miller

vsock/virtio: reset connected sockets on device removal

When the virtio transport device disappear, we should reset all
connected sockets in order to inform the users.
Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 22b5c0b6
...@@ -634,6 +634,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev) ...@@ -634,6 +634,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev)
flush_work(&vsock->event_work); flush_work(&vsock->event_work);
flush_work(&vsock->send_pkt_work); flush_work(&vsock->send_pkt_work);
/* Reset all connected sockets when the device disappear */
vsock_for_each_connected_socket(virtio_vsock_reset_sock);
vdev->config->reset(vdev); vdev->config->reset(vdev);
mutex_lock(&vsock->rx_lock); mutex_lock(&vsock->rx_lock);
......
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