aboutsummaryrefslogtreecommitdiff
path: root/migration/migration.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2021-09-29 16:43:10 +0200
committerJuan Quintela <quintela@trasno.org>2021-11-03 09:38:53 +0100
commit458fecca80963b4c2c2164889d817542d2cece4f (patch)
tree0160e8b19e85842063eeb930216d516cecd08560 /migration/migration.c
parent741bdeb1d5a4024a2c54c6abb2de493a27b61953 (diff)
downloadqemu-458fecca80963b4c2c2164889d817542d2cece4f.zip
qemu-458fecca80963b4c2c2164889d817542d2cece4f.tar.gz
qemu-458fecca80963b4c2c2164889d817542d2cece4f.tar.bz2
migration: provide an error message to migration_cancel()
This avoids to call migrate_get_current() in the caller function whereas migration_cancel() already needs the pointer to the current migration state. Signed-off-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 53b9a8a..ec3d87f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -215,8 +215,11 @@ void migration_object_init(void)
dirty_bitmap_mig_init();
}
-void migration_cancel(void)
+void migration_cancel(const Error *error)
{
+ if (error) {
+ migrate_set_error(current_migration, error);
+ }
migrate_fd_cancel(current_migration);
}
@@ -226,7 +229,7 @@ void migration_shutdown(void)
* Cancel the current migration - that will (eventually)
* stop the migration using this structure
*/
- migration_cancel();
+ migration_cancel(NULL);
object_unref(OBJECT(current_migration));
/*
@@ -2334,7 +2337,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
void qmp_migrate_cancel(Error **errp)
{
- migration_cancel();
+ migration_cancel(NULL);
}
void qmp_migrate_continue(MigrationStatus state, Error **errp)