@@ -406,16 +406,19 @@ void migrate_fd_cancel(MigrationState *mig_state)
{
FdMigrationState *s = migrate_to_fms(mig_state);
- if (s->state != MIG_STATE_ACTIVE)
+ if (s->state == MIG_STATE_CANCELLED) {
return;
+ }
DPRINTF("cancelling migration\n");
s->state = MIG_STATE_CANCELLED;
notifier_list_notify(&migration_state_notifiers);
- qemu_savevm_state_cancel(s->mon, s->file);
- migrate_fd_cleanup(s);
+ if (s->file) {
+ qemu_savevm_state_cancel(s->mon, s->file);
+ migrate_fd_cleanup(s);
+ }
}
void migrate_fd_release(MigrationState *mig_state)
After migration failure, even a user commands migrate_cancel, it keeps saying: Migration status: failed This patch checks s->state == MIG_STATE_CANCEL instead of s->state != MIG_STATE_ACTIVE. With this patch the message above would be: Migration status: cancelled Please note that the following patches are prerequisite. http://www.mail-archive.com/qemu-devel@nongnu.org/msg56448.html http://www.mail-archive.com/qemu-devel@nongnu.org/msg56446.html Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> --- migration.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)