[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 30/57] migration_completion: Take current state
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 30/57] migration_completion: Take current state |
Date: |
Mon, 9 Nov 2015 18:28:34 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Soon we'll be in either ACTIVE or POSTCOPY_ACTIVE when we
complete migration, and we need to know which we expect to be
in to change state safely.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/migration.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index f5cb9c5..d6f6f4c 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1243,10 +1243,12 @@ static int
await_return_path_close_on_source(MigrationState *ms)
* The caller 'breaks' the loop when this returns.
*
* @s: Current migration state
+ * @current_active_state: The migration state we expect to be in
* @*old_vm_running: Pointer to old_vm_running flag
* @*start_time: Pointer to time to update
*/
-static void migration_completion(MigrationState *s, bool *old_vm_running,
+static void migration_completion(MigrationState *s, int current_active_state,
+ bool *old_vm_running,
int64_t *start_time)
{
int ret;
@@ -1275,11 +1277,11 @@ static void migration_completion(MigrationState *s,
bool *old_vm_running,
goto fail;
}
- migrate_set_state(s, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_COMPLETED);
+ migrate_set_state(s, current_active_state, MIGRATION_STATUS_COMPLETED);
return;
fail:
- migrate_set_state(s, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED);
+ migrate_set_state(s, current_active_state, MIGRATION_STATUS_FAILED);
}
/*
@@ -1321,7 +1323,8 @@ static void *migration_thread(void *opaque)
qemu_savevm_state_iterate(s->file);
} else {
trace_migration_thread_low_pending(pending_size);
- migration_completion(s, &old_vm_running, &start_time);
+ migration_completion(s, MIGRATION_STATUS_ACTIVE,
+ &old_vm_running, &start_time);
break;
}
}
--
2.5.0
- [Qemu-devel] [PULL 21/57] migration_is_setup_or_active, (continued)
- [Qemu-devel] [PULL 21/57] migration_is_setup_or_active, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 19/57] Return path: Control commands, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 24/57] Add migration-capability boolean for postcopy-ram., Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 22/57] Return path: Source handling of return path, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 25/57] Add wrappers and handlers for sending/receiving the postcopy-ram migration messages., Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 26/57] MIG_CMD_PACKAGED: Send a packaged chunk of migration stream, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 23/57] Rework loadvm path for subloops, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 27/57] Modify save_live_pending for postcopy, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 31/57] MIGRATION_STATUS_POSTCOPY_ACTIVE: Add new migration state, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 28/57] postcopy: OS support test, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 30/57] migration_completion: Take current state,
Juan Quintela <=
- [Qemu-devel] [PULL 32/57] Avoid sending vmdescription during postcopy, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 29/57] migrate_start_postcopy: Command to trigger transition to postcopy, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 33/57] Add qemu_savevm_state_complete_postcopy, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 35/57] migration_completion: Take current state, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 36/57] postcopy: Incoming initialisation, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 34/57] Postcopy: Maintain unsentmap, Juan Quintela, 2015/11/09
- [Qemu-devel] [PULL 38/57] Postcopy: Postcopy startup in migration thread, Juan Quintela, 2015/11/09