]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio: Open code vfio_migration_set_error()
authorCédric Le Goater <clg@redhat.com>
Mon, 24 Mar 2025 12:33:15 +0000 (13:33 +0100)
committerCédric Le Goater <clg@redhat.com>
Fri, 25 Apr 2025 07:01:37 +0000 (09:01 +0200)
commit10c7f1cf2c9d5af28dbc342634eb1f3979a7c379
tree81f5412a5a364af9a65df0c37d0fc1a80baa40e3
parent5dbe25e9db070ea87c173fd9a4dc0932ee6d1b41
vfio: Open code vfio_migration_set_error()

VFIO uses migration_file_set_error() in a couple of places where an
'Error **' parameter is not provided. In MemoryListener handlers :

  vfio_listener_region_add
  vfio_listener_log_global_stop
  vfio_listener_log_sync

and in callback routines for IOMMU notifiers :

  vfio_iommu_map_notify
  vfio_iommu_map_dirty_notify

Hopefully, one day, we will be able to extend these callbacks with an
'Error **' parameter and avoid setting the global migration error.
Until then, it seems sensible to clearly identify the use cases, which
are limited, and open code vfio_migration_set_error(). One other
benefit is an improved error reporting when migration is running.

While at it, slightly modify error reporting to only report errors
when migration is not active and not always as is currently done.

Cc: Prasad Pandit <pjp@fedoraproject.org>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Link: https://lore.kernel.org/qemu-devel/20250324123315.637827-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/common.c