Hello, This follows up on Peter's series [1] to simplify migration status API to a single migration_is_running() function.
Peter's series tried to drop migration_is_device() and migration_is_active(), however VFIO used them to check if dirty page tracking has been started in order to avoid errors in log sync, so they couldn't simply be dropped without some preliminary cleanups. This series handles these preliminary cleanups and eventually drops migration_is_device() and unexports migration_is_active(). The series has been migration tested with the following: - VFIO device dirty tracking. - Legacy VFIO iommu dirty tracking. - vIOMMU + Legacy VFIO iommu dirty tracking (migration with vIOMMU is currently blocked, so I used a patched QEMU to allow it). I didn't test it with iommu DPT as I don't have access to such HW. Cedric, I remember you said that you have such HW, it would be very helpful if you could test it. Patch structure: 1-6: Refactor and clean up VFIO dirty page tracking helpers. 7: Refactor dirty limit code. 8-9: Drop/unexport migration_is_device() and migration_is_running(). Thanks. [1] https://lore.kernel.org/qemu-devel/20241024213056.1395400-1-pet...@redhat.com/ Avihai Horon (9): vfio/container: Add dirty tracking started flag vfio/migration: Refactor vfio_devices_all_dirty_tracking() logic vfio/migration: Refactor vfio_devices_all_running_and_mig_active() logic vfio/migration: Add vfio_devices_all_dirty_tracking_started() helper vfio/migration: Drop vfio_dma_unmap_dirty_sync_needed() vfio/migration: Rename vfio_devices_all_dirty_tracking() system/dirtylimit: Don't use migration_is_active() migration: Drop migration_is_device() migration: Unexport migration_is_active() include/hw/vfio/vfio-common.h | 4 +- include/hw/vfio/vfio-container-base.h | 1 + include/migration/misc.h | 2 - hw/vfio/common.c | 61 ++++++++++++--------------- hw/vfio/container-base.c | 8 +++- hw/vfio/container.c | 2 +- migration/migration.c | 23 ++++------ system/dirtylimit.c | 3 +- 8 files changed, 48 insertions(+), 56 deletions(-) -- 2.40.1