| From: "Michael S. Tsirkin" <mst@redhat.com> |
| Date: Fri, 20 Apr 2018 20:22:40 +0300 |
| Subject: virtio: add ability to iterate over vqs |
| |
| commit 24a7e4d20783c0514850f24a5c41ede46ab058f0 upstream. |
| |
| For cleanup it's helpful to be able to simply scan all vqs and discard |
| all data. Add an iterator to do that. |
| |
| Signed-off-by: Michael S. Tsirkin <mst@redhat.com> |
| Signed-off-by: Ben Hutchings <ben@decadent.org.uk> |
| --- |
| include/linux/virtio.h | 3 +++ |
| 1 file changed, 3 insertions(+) |
| |
| --- a/include/linux/virtio.h |
| +++ b/include/linux/virtio.h |
| @@ -108,6 +108,9 @@ void unregister_virtio_device(struct vir |
| |
| void virtio_break_device(struct virtio_device *dev); |
| |
| +#define virtio_device_for_each_vq(vdev, vq) \ |
| + list_for_each_entry(vq, &vdev->vqs, list) |
| + |
| /** |
| * virtio_driver - operations for a virtio I/O driver |
| * @driver: underlying device driver (populate name and owner). |