aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorSteve Sistare <steven.sistare@oracle.com>2024-03-11 10:48:55 -0700
committerPeter Xu <peterx@redhat.com>2024-03-11 16:28:59 -0400
commit20c64c8a51a477115589b3a9f7304e423dcbe7f2 (patch)
tree6d721b0f1f455dd4fa1bb62897513c739e23323c /migration/migration.c
parent9bb630c6ee6e930e1c521829681365e5672bbd99 (diff)
downloadqemu-20c64c8a51a477115589b3a9f7304e423dcbe7f2.zip
qemu-20c64c8a51a477115589b3a9f7304e423dcbe7f2.tar.gz
qemu-20c64c8a51a477115589b3a9f7304e423dcbe7f2.tar.bz2
migration: migration_file_set_error
Define and export migration_file_set_error to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> Link: https://lore.kernel.org/r/1710179338-294359-9-git-send-email-steven.sistare@oracle.com Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/migration/migration.c b/migration/migration.c
index db1e627..216f63d 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3038,6 +3038,17 @@ static MigThrError postcopy_pause(MigrationState *s)
}
}
+void migration_file_set_error(int err)
+{
+ MigrationState *s = current_migration;
+
+ WITH_QEMU_LOCK_GUARD(&s->qemu_file_lock) {
+ if (s->to_dst_file) {
+ qemu_file_set_error(s->to_dst_file, err);
+ }
+ }
+}
+
static MigThrError migration_detect_error(MigrationState *s)
{
int ret;