summaryrefslogtreecommitdiffstats
path: root/migration/migration.c
diff options
context:
space:
mode:
authorRichard Henderson2021-11-04 05:47:37 +0100
committerRichard Henderson2021-11-04 05:47:37 +0100
commit752e235464d62d31f14a9790b4b24e396c86bb0e (patch)
tree50a3142b43bbf9d14d4a3210ef303458876efc9d /migration/migration.c
parentMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (diff)
parentOptimized the function of fill_connection_key. (diff)
downloadqemu-752e235464d62d31f14a9790b4b24e396c86bb0e.tar.gz
qemu-752e235464d62d31f14a9790b4b24e396c86bb0e.tar.xz
qemu-752e235464d62d31f14a9790b4b24e396c86bb0e.zip
Merge remote-tracking branch 'remotes/juanquintela/tags/migration-20211102-pull-request' into staging
Migration Pull request Hi This are the pending migration patches on the list: - Provide an error message for migration_cancel by Laurent - Don't dump colo cache when a guest core is requested by Lukas - Initialise Compression_conters for new migration by Yuxiating On top of that I added another missing initialization - Colo optimizations and crash improvements by Rao. Please, apply. # gpg: Signature made Wed 03 Nov 2021 04:45:35 AM EDT # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full] # gpg: aka "Juan Quintela <quintela@trasno.org>" [full] * remotes/juanquintela/tags/migration-20211102-pull-request: Optimized the function of fill_connection_key. colo: Don't dump colo cache if dump-guest-core=off Changed the last-mode to none of first start COLO Removed the qemu_fclose() in colo_process_incoming_thread colo: fixed 'Segmentation fault' when the simplex mode PVM poweroff Fixed SVM hang when do failover before PVM crash Fixed qemu crash when guest power off in COLO mode Some minor optimizations for COLO migration: Zero migration compression counters migration: initialise compression_counters for a new migration migration: provide an error message to migration_cancel() Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'migration/migration.c')
-rw-r--r--migration/migration.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/migration/migration.c b/migration/migration.c
index 53b9a8af96..abaf6f9e3d 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -215,8 +215,11 @@ void migration_object_init(void)
dirty_bitmap_mig_init();
}
-void migration_cancel(void)
+void migration_cancel(const Error *error)
{
+ if (error) {
+ migrate_set_error(current_migration, error);
+ }
migrate_fd_cancel(current_migration);
}
@@ -226,7 +229,7 @@ void migration_shutdown(void)
* Cancel the current migration - that will (eventually)
* stop the migration using this structure
*/
- migration_cancel();
+ migration_cancel(NULL);
object_unref(OBJECT(current_migration));
/*
@@ -587,8 +590,10 @@ static void process_incoming_migration_co(void *opaque)
mis->have_colo_incoming_thread = true;
qemu_coroutine_yield();
+ qemu_mutex_unlock_iothread();
/* Wait checkpoint incoming thread exit before free resource */
qemu_thread_join(&mis->colo_incoming_thread);
+ qemu_mutex_lock_iothread();
/* We hold the global iothread lock, so it is safe here */
colo_release_ram_cache();
}
@@ -2268,10 +2273,11 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
migrate_init(s);
/*
- * set ram_counters memory to zero for a
+ * set ram_counters compression_counters memory to zero for a
* new migration
*/
memset(&ram_counters, 0, sizeof(ram_counters));
+ memset(&compression_counters, 0, sizeof(compression_counters));
return true;
}
@@ -2334,7 +2340,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
void qmp_migrate_cancel(Error **errp)
{
- migration_cancel();
+ migration_cancel(NULL);
}
void qmp_migrate_continue(MigrationStatus state, Error **errp)
@@ -3622,7 +3628,9 @@ static void migration_iteration_finish(MigrationState *s)
case MIGRATION_STATUS_CANCELLED:
case MIGRATION_STATUS_CANCELLING:
if (s->vm_was_running) {
- vm_start();
+ if (!runstate_check(RUN_STATE_SHUTDOWN)) {
+ vm_start();
+ }
} else {
if (runstate_check(RUN_STATE_FINISH_MIGRATE)) {
runstate_set(RUN_STATE_POSTMIGRATE);