aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorLi Zhijian <lizhijian@fujitsu.com>2024-05-16 11:45:16 +0800
committerFabiano Rosas <farosas@suse.de>2024-05-22 17:34:31 -0300
commit787ea49e80df0e7af922586f6076da94410cdd08 (patch)
tree3d9562175d3a2b4f1964a1d74425bfb1ce43080f /migration
parent55a331655dbc8feee198f379eaafa3e75e744b7b (diff)
migration/colo: make colo_incoming_co() return void
Currently, it always returns 0, no need to check the return value at all. In addition, enter colo coroutine only if migration_incoming_colo_enabled() is true. Once the destination side enters the COLO* state, the COLO process will take over the remaining processes until COLO exits. Cc: Fabiano Rosas <farosas@suse.de> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com> [fixed mangled author email address] Signed-off-by: Fabiano Rosas <farosas@suse.de>
Diffstat (limited to 'migration')
-rw-r--r--migration/colo-stubs.c3
-rw-r--r--migration/colo.c9
-rw-r--r--migration/migration.c6
3 files changed, 6 insertions, 12 deletions
diff --git a/migration/colo-stubs.c b/migration/colo-stubs.c
index f8c069b739..e22ce65234 100644
--- a/migration/colo-stubs.c
+++ b/migration/colo-stubs.c
@@ -9,9 +9,8 @@ void colo_shutdown(void)
{
}
-int coroutine_fn colo_incoming_co(void)
+void coroutine_fn colo_incoming_co(void)
{
- return 0;
}
void colo_checkpoint_delay_set(void)
diff --git a/migration/colo.c b/migration/colo.c
index e2b450c132..ca37b932ac 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -928,16 +928,13 @@ out:
return NULL;
}
-int coroutine_fn colo_incoming_co(void)
+void coroutine_fn colo_incoming_co(void)
{
MigrationIncomingState *mis = migration_incoming_get_current();
QemuThread th;
assert(bql_locked());
-
- if (!migration_incoming_colo_enabled()) {
- return 0;
- }
+ assert(migration_incoming_colo_enabled());
qemu_thread_create(&th, "COLO incoming", colo_process_incoming_thread,
mis, QEMU_THREAD_JOINABLE);
@@ -953,6 +950,4 @@ int coroutine_fn colo_incoming_co(void)
/* We hold the global BQL, so it is safe here */
colo_release_ram_cache();
-
- return 0;
}
diff --git a/migration/migration.c b/migration/migration.c
index 995f0ca923..c004637d29 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -776,9 +776,9 @@ process_incoming_migration_co(void *opaque)
goto fail;
}
- if (colo_incoming_co() < 0) {
- error_setg(&local_err, "colo incoming failed");
- goto fail;
+ if (migration_incoming_colo_enabled()) {
+ /* yield until COLO exit */
+ colo_incoming_co();
}
migration_bh_schedule(process_incoming_migration_bh, mis);