From aefeb18bde45fa629e3055a7bb6637a7dcad8c36 Mon Sep 17 00:00:00 2001 From: "Dr. David Alan Gilbert" Date: Thu, 5 Nov 2015 18:10:40 +0000 Subject: migrate_init: Call from savevm Suspend to file is very much like a migrate, and it makes life easier if we have the Migration state available, so initialise it in the savevm.c code for suspending. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: David Gibson Reviewed-by: Juan Quintela Reviewd-by: Amit Shah Signed-off-by: Juan Quintela --- migration/migration.c | 2 +- migration/savevm.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'migration') diff --git a/migration/migration.c b/migration/migration.c index 6fef5445c9..82efbeb772 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -682,7 +682,7 @@ bool migration_has_failed(MigrationState *s) s->state == MIGRATION_STATUS_FAILED); } -static MigrationState *migrate_init(const MigrationParams *params) +MigrationState *migrate_init(const MigrationParams *params) { MigrationState *s = migrate_get_current(); int64_t bandwidth_limit = s->bandwidth_limit; diff --git a/migration/savevm.c b/migration/savevm.c index 638aa1f612..9dc57d3fd9 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -922,6 +922,8 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) .blk = 0, .shared = 0 }; + MigrationState *ms = migrate_init(¶ms); + ms->file = f; if (qemu_savevm_state_blocked(errp)) { return -EINVAL; -- cgit v1.2.3