diff options
| author | Denis V. Lunev <den@openvz.org> | 2026-06-24 16:08:43 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2026-08-19 06:38:44 -0400 |
| commit | 0d8aebe089b4ba887e792884cf041ce9f1040ff4 (patch) | |
| tree | 75ec382088f6e84f457a420c2f38baa0c6fdfdd9 /include | |
| parent | 2187be212179243f33da1271248571aca3e99a3f (diff) | |
virtio: add virtio_device_shutdown() helper
The generic virtio bus .shutdown handler, virtio_dev_shutdown(), breaks
and resets a device once it has established that the driver has no
.shutdown of its own. A driver that does implement .shutdown, to quiesce
its own activity first, still needs the same break and reset afterwards
and would otherwise have to open code it.
Factor the break + synchronize_cbs + reset sequence out of
virtio_dev_shutdown() into an exported virtio_device_shutdown() helper so
such drivers can reuse it instead of duplicating the core logic.
No functional change.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260624140846.2616797-2-den@openvz.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/virtio.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 93e573c56563..f923e42cfd01 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -213,6 +213,7 @@ int virtio_device_freeze(struct virtio_device *dev); int virtio_device_restore(struct virtio_device *dev); #endif void virtio_reset_device(struct virtio_device *dev); +void virtio_device_shutdown(struct virtio_device *dev); int virtio_device_reset_prepare(struct virtio_device *dev); int virtio_device_reset_done(struct virtio_device *dev); |
