From 819a5865c0524c4bfcf1906955c9d15952fdbcc7 Mon Sep 17 00:00:00 2001 From: Cédric Le Goater Date: Wed, 26 Mar 2025 08:51:10 +0100 Subject: vfio: Move vfio_reset_handler() into device.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass-through devices of a VM are not necessarily in the same group and all groups/address_spaces need to be scanned when the machine is reset. Commit f16f39c3fc97 ("Implement PCI hot reset") introduced a VM reset handler for this purpose. Move it under device.c Also reintroduce the comment which explained the context and was lost along the way. Reviewed-by: Zhenzhong Duan Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-26-clg@redhat.com Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'hw/vfio/common.c') diff --git a/hw/vfio/common.c b/hw/vfio/common.c index a85ed36409..45ac8b7d8b 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1300,21 +1300,3 @@ const MemoryListener vfio_memory_listener = { .log_global_stop = vfio_listener_log_global_stop, .log_sync = vfio_listener_log_sync, }; - -void vfio_reset_handler(void *opaque) -{ - VFIODevice *vbasedev; - - trace_vfio_reset_handler(); - QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) { - if (vbasedev->dev->realized) { - vbasedev->ops->vfio_compute_needs_reset(vbasedev); - } - } - - QLIST_FOREACH(vbasedev, &vfio_device_list, global_next) { - if (vbasedev->dev->realized && vbasedev->needs_reset) { - vbasedev->ops->vfio_hot_reset_multi(vbasedev); - } - } -} -- cgit 1.4.1