diff options
author | Peter Xu <peterx@redhat.com> | 2018-01-03 20:20:09 +0800 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2018-01-15 12:48:08 +0100 |
commit | 7287cbd46e2d6fb582ca78c3cb49b1e53d91a761 (patch) | |
tree | 94a880aa965440eb333fc5234563d98fa05cd4e6 /migration/migration.h | |
parent | 4af246a34e3155365e6be9dda201f3467d0498d9 (diff) |
migration: move vm_old_running into global state
Firstly, it was passed around. Let's just move it into MigrationState
just like many other variables as state of migration, renaming it to
vm_was_running.
One thing to mention is that for postcopy, we actually don't need this
knowledge at all since postcopy can't resume a VM even if it fails (we
can see that from the old code too: when we try to resume we also check
against "entered_postcopy" variable). So further we do this:
- in postcopy_start(), we don't update vm_old_running since useless
- in migration_thread(), we don't need to check entered_postcopy when
resume, since it's only used for precopy.
Comment this out too for that variable definition.
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/migration.h')
-rw-r--r-- | migration/migration.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/migration/migration.h b/migration/migration.h index d1132b1cf7..4cae263992 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -123,6 +123,12 @@ struct MigrationState int64_t expected_downtime; bool enabled_capabilities[MIGRATION_CAPABILITY__MAX]; int64_t setup_time; + /* + * Whether guest was running when we enter the completion stage. + * If migration is interrupted by any reason, we need to continue + * running the guest on source. + */ + bool vm_was_running; /* Flag set once the migration has been asked to enter postcopy */ bool start_postcopy; |