Skip to content

Commit

Permalink
9p/trans_virtio: reset virtio device on remove
Browse files Browse the repository at this point in the history
On device shutdown/removal, virtio drivers need to trigger a reset on
the device; if this is neglected, the virtio core will complain about
non-zero device status.

This patch resets the status when the 9p virtio driver is removed
from the system by calling vdev->config->reset on the virtio_device
to send a reset to the host virtio device.

Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Pierre Morel authored and mstsirkin committed Jul 13, 2015
1 parent 1b568d9 commit ea52bf8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/9p/trans_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ static void p9_virtio_remove(struct virtio_device *vdev)

mutex_unlock(&virtio_9p_lock);

vdev->config->reset(vdev);
vdev->config->del_vqs(vdev);

sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr);
Expand Down

0 comments on commit ea52bf8

Please sign in to comment.