diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2018-04-20 13:22:40 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-04-25 13:33:19 -0400 |
commit | 24a7e4d20783c0514850f24a5c41ede46ab058f0 (patch) | |
tree | 5d012612c580d047f5300f0b3333bf7bee9ac106 | |
parent | 2855b33514d290c51d52d94e25d3ef942cd4d578 (diff) |
virtio: add ability to iterate over vqs
For cleanup it's helpful to be able to simply scan all vqs and discard
all data. Add an iterator to do that.
Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r-- | include/linux/virtio.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 988c7355bc22..fa1b5da2804e 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -157,6 +157,9 @@ int virtio_device_freeze(struct virtio_device *dev); | |||
157 | int virtio_device_restore(struct virtio_device *dev); | 157 | int virtio_device_restore(struct virtio_device *dev); |
158 | #endif | 158 | #endif |
159 | 159 | ||
160 | #define virtio_device_for_each_vq(vdev, vq) \ | ||
161 | list_for_each_entry(vq, &vdev->vqs, list) | ||
162 | |||
160 | /** | 163 | /** |
161 | * virtio_driver - operations for a virtio I/O driver | 164 | * virtio_driver - operations for a virtio I/O driver |
162 | * @driver: underlying device driver (populate name and owner). | 165 | * @driver: underlying device driver (populate name and owner). |