On 7/2/24 14:33, Cédric Le Goater wrote:
vfio_set_migration_error() sets the 'return' error on the migration
stream if a migration is in progress. To improve error reporting, add
a new Error* argument to also set the Error object on the migration
stream.

Signed-off-by: Cédric Le Goater <c...@redhat.com>
---
  hw/vfio/common.c | 50 +++++++++++++++++++++++++++++-------------------
  1 file changed, 30 insertions(+), 20 deletions(-)


-static void vfio_set_migration_error(int err)
+static void vfio_set_migration_error(int ret, Error *err)

Maybe rename vfio_report_migration_error() for clarity?

  {
      MigrationState *ms = migrate_get_current();
if (migration_is_setup_or_active(ms->state)) {
          WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) {
              if (ms->to_dst_file) {
-                qemu_file_set_error(ms->to_dst_file, err);
+                qemu_file_set_error_obj(ms->to_dst_file, ret, err);
              }
          }
+    } else {
+        error_report_err(err);
      }
  }


Reply via email to