Skip to content

Commit

Permalink
vsock/virtio: reset connected sockets on device removal
Browse files Browse the repository at this point in the history
When the virtio transport device disappear, we should reset all
connected sockets in order to inform the users.

Signed-off-by: Stefano Garzarella <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
stefano-garzarella authored and davem330 committed Feb 3, 2019
1 parent 22b5c0b commit 8596548
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/vmw_vsock/virtio_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev)
flush_work(&vsock->event_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);

mutex_lock(&vsock->rx_lock);
Expand Down

0 comments on commit 8596548

Please sign in to comment.