File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -865,4 +865,19 @@ bool virtqueue_is_broken(struct virtqueue *_vq)
865
865
}
866
866
EXPORT_SYMBOL_GPL (virtqueue_is_broken );
867
867
868
+ /*
869
+ * This should prevent the device from being used, allowing drivers to
870
+ * recover. You may need to grab appropriate locks to flush.
871
+ */
872
+ void virtio_break_device (struct virtio_device * dev )
873
+ {
874
+ struct virtqueue * _vq ;
875
+
876
+ list_for_each_entry (_vq , & dev -> vqs , list ) {
877
+ struct vring_virtqueue * vq = to_vvq (_vq );
878
+ vq -> broken = true;
879
+ }
880
+ }
881
+ EXPORT_SYMBOL_GPL (virtio_break_device );
882
+
868
883
MODULE_LICENSE ("GPL" );
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ static inline struct virtio_device *dev_to_virtio(struct device *_dev)
106
106
int register_virtio_device (struct virtio_device * dev );
107
107
void unregister_virtio_device (struct virtio_device * dev );
108
108
109
+ void virtio_break_device (struct virtio_device * dev );
110
+
109
111
/**
110
112
* virtio_driver - operations for a virtio I/O driver
111
113
* @driver: underlying device driver (populate name and owner).
You can’t perform that action at this time.
0 commit comments