[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/21] migration: restore vmstate on migration failure
|
From: |
Juan Quintela |
|
Subject: |
[PULL 05/21] migration: restore vmstate on migration failure |
|
Date: |
Tue, 30 May 2023 20:25:15 +0200 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
1. Otherwise failed migration just drops guest-panicked state, which is
not good for management software.
2. We do keep different paused states like guest-panicked during
migration with help of global_state state.
3. We do restore running state on source when migration is cancelled or
failed.
4. "postmigrate" state is documented as "guest is paused following a
successful 'migrate'", so originally it's only for successful path
and we never documented current behavior.
Let's restore paused states like guest-panicked in case of cancel or
fail too. Allow same transitions like for inmigrate state.
This commit changes the behavior that was introduced by commit
42da5550d6 "migration: set state to post-migrate on failure" and
provides a bit different fix on related
https://bugzilla.redhat.com/show_bug.cgi?id=1355683
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230517123752.21615-6-vsementsov@yandex-team.ru>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/migration.c | 2 +-
softmmu/runstate.c | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 033162cda0..7c3425c6fe 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2772,7 +2772,7 @@ static void migration_iteration_finish(MigrationState *s)
}
} else {
if (runstate_check(RUN_STATE_FINISH_MIGRATE)) {
- runstate_set(RUN_STATE_POSTMIGRATE);
+ runstate_set(s->vm_old_state);
}
}
break;
diff --git a/softmmu/runstate.c b/softmmu/runstate.c
index 0370230a5e..1957caf73f 100644
--- a/softmmu/runstate.c
+++ b/softmmu/runstate.c
@@ -121,7 +121,13 @@ static const RunStateTransition runstate_transitions_def[]
= {
{ RUN_STATE_FINISH_MIGRATE, RUN_STATE_PAUSED },
{ RUN_STATE_FINISH_MIGRATE, RUN_STATE_POSTMIGRATE },
{ RUN_STATE_FINISH_MIGRATE, RUN_STATE_PRELAUNCH },
- { RUN_STATE_FINISH_MIGRATE, RUN_STATE_COLO},
+ { RUN_STATE_FINISH_MIGRATE, RUN_STATE_COLO },
+ { RUN_STATE_FINISH_MIGRATE, RUN_STATE_INTERNAL_ERROR },
+ { RUN_STATE_FINISH_MIGRATE, RUN_STATE_IO_ERROR },
+ { RUN_STATE_FINISH_MIGRATE, RUN_STATE_SHUTDOWN },
+ { RUN_STATE_FINISH_MIGRATE, RUN_STATE_SUSPENDED },
+ { RUN_STATE_FINISH_MIGRATE, RUN_STATE_WATCHDOG },
+ { RUN_STATE_FINISH_MIGRATE, RUN_STATE_GUEST_PANICKED },
{ RUN_STATE_RESTORE_VM, RUN_STATE_RUNNING },
{ RUN_STATE_RESTORE_VM, RUN_STATE_PRELAUNCH },
--
2.40.1
- [PULL 21/21] migration/rdma: Check sooner if we are in postcopy for save_page(), (continued)
- [PULL 21/21] migration/rdma: Check sooner if we are in postcopy for save_page(), Juan Quintela, 2023/05/30
- [PULL 12/21] migration: Create migrate_rdma(), Juan Quintela, 2023/05/30
- [PULL 13/21] migration/rdma: Unfold ram_control_before_iterate(), Juan Quintela, 2023/05/30
- [PULL 17/21] migration/rdma: Create rdma_control_save_page(), Juan Quintela, 2023/05/30
- [PULL 20/21] migration/rdma: Remove qemu_ prefix from exported functions, Juan Quintela, 2023/05/30
- Re: [PULL 00/21] Migration 20230530 patches, Richard Henderson, 2023/05/30
- [PULL 00/21] Migration 20230530 patches, Juan Quintela, 2023/05/30
- [PULL 03/21] runstate: drop unused runstate_store(), Juan Quintela, 2023/05/30
- [PULL 06/21] migration: Don't abuse qemu_file transferred for RDMA, Juan Quintela, 2023/05/30
- [PULL 05/21] migration: restore vmstate on migration failure,
Juan Quintela <=
- [PULL 10/21] migration: Remove unused qemu_file_credit_transfer(), Juan Quintela, 2023/05/30
- [PULL 02/21] migration: never fail in global_state_store(), Juan Quintela, 2023/05/30
- [PULL 01/21] runstate: add runstate_get(), Juan Quintela, 2023/05/30
- [PULL 04/21] migration: switch from .vm_was_running to .vm_old_state, Juan Quintela, 2023/05/30
- [PULL 07/21] migration/RDMA: It is accounting for zero/normal pages in two places, Juan Quintela, 2023/05/30
- [PULL 08/21] migration/rdma: Remove QEMUFile parameter when not used, Juan Quintela, 2023/05/30
- [PULL 11/21] migration/rdma: Simplify the function that saves a page, Juan Quintela, 2023/05/30
- [PULL 12/21] migration: Create migrate_rdma(), Juan Quintela, 2023/05/30
- [PULL 14/21] migration/rdma: Unfold ram_control_after_iterate(), Juan Quintela, 2023/05/30
- [PULL 15/21] migration/rdma: Remove all uses of RAM_CONTROL_HOOK, Juan Quintela, 2023/05/30