@@ -145,6 +145,11 @@ struct MigrationState
int state;
/* Old style params from 'migrate' command */
MigrationParams params;
+ /*
+ * Don't need 2 variables for recovery.
+ * Clean this up, use a single variable with different states.
+ */
+ bool recovered_once;
bool in_recovery;
/* State related to return path */
@@ -1042,6 +1042,7 @@ MigrationState *migrate_init(const MigrationParams *params)
s->xfer_limit = 0;
s->cleanup_bh = 0;
s->to_dst_file = NULL;
+ s->recovered_once = false;
s->in_recovery = false;
s->state = MIGRATION_STATUS_NONE;
s->params = *params;
@@ -1925,6 +1926,7 @@ static void *migration_thread(void *opaque)
if(ret == 0) {
current_active_state = MIGRATION_STATUS_POSTCOPY_ACTIVE;
runstate_set(RUN_STATE_FINISH_MIGRATE);
+ s->recovered_once = true;
qemu_file_clear_error(s->to_dst_file);
continue;
}
@@ -986,6 +986,11 @@ void qemu_savevm_state_complete_postcopy(QEMUFile *f)
{
SaveStateEntry *se;
int ret;
+ MigrationState *ms = migrate_get_current();
+
+ if (ms->recovered_once) {
+ qemu_savevm_command_send(f, MIG_CMD_POSTCOPY_RECOVERY, 0, NULL);
+ }
QTAILQ_FOREACH(se, &savevm_state.handlers, entry) {
if (!se->ops || !se->ops->save_live_complete_postcopy) {
Signed-off-by: Md Haris Iqbal <haris.phnx@gmail.com> --- include/migration/migration.h | 5 +++++ migration/migration.c | 2 ++ migration/savevm.c | 5 +++++ 3 files changed, 12 insertions(+)