From: Lukas Straub <lukasstraub2@web.de>
To: qemu-devel@nongnu.org
Cc: Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Zhang Chen <zhangckid@gmail.com>,
Hailiang Zhang <zhanghailiang@xfusion.com>,
Markus Armbruster <armbru@redhat.com>,
Li Zhijian <lizhijian@fujitsu.com>,
"Dr. David Alan Gilbert" <dave@treblig.org>,
Lukas Straub <lukasstraub2@web.de>
Subject: [PATCH v9 04/19] colo: Replace migration_incoming_colo_enabled() with migrate_colo()
Date: Wed, 18 Feb 2026 22:29:24 +0100 [thread overview]
Message-ID: <20260218-colo_unit_test_multifd-v9-4-d8dbdb0ca6f6@web.de> (raw)
In-Reply-To: <20260218-colo_unit_test_multifd-v9-0-d8dbdb0ca6f6@web.de>
Since
121ccedc2b migration: block incoming colo when capability is disabled
x-colo capability needs to be always enabled on the incoming side.
So migration_incoming_colo_enabled() and migrate_colo() are equivalent
with migrate_colo() being easier to reason about since it is always true
during the whole migration.
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
include/migration/colo.h | 1 -
migration/colo.c | 2 +-
migration/migration.c | 9 ++-------
migration/ram.c | 2 +-
4 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/include/migration/colo.h b/include/migration/colo.h
index d4fe422e4d335d3bef4f860f56400fcd73287a0e..2496a968cc1ce709f706c0efe57e4f765f163d3c 100644
--- a/include/migration/colo.h
+++ b/include/migration/colo.h
@@ -27,7 +27,6 @@ bool migration_in_colo_state(void);
/* loadvm */
int migration_incoming_enable_colo(Error **errp);
void migration_incoming_disable_colo(void);
-bool migration_incoming_colo_enabled(void);
bool migration_incoming_in_colo_state(void);
COLOMode get_colo_mode(void);
diff --git a/migration/colo.c b/migration/colo.c
index f7a5bd3619a49a3b4a8306973de7a4411cc0df58..97a224c39c49ff2269f375db47112458cab0b4cb 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -935,7 +935,7 @@ void coroutine_fn colo_incoming_co(void)
QemuThread th;
assert(bql_locked());
- assert(migration_incoming_colo_enabled());
+ assert(migrate_colo());
qemu_thread_create(&th, MIGRATION_THREAD_DST_COLO,
colo_process_incoming_thread,
diff --git a/migration/migration.c b/migration/migration.c
index c2b9621190f8678ac6b32d6794d9bcb6ffa5e402..ef6aac53343f2217cd1aa37e493483703068d1ff 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -605,11 +605,6 @@ int migrate_send_rp_req_pages(MigrationIncomingState *mis,
}
static bool migration_colo_enabled;
-bool migration_incoming_colo_enabled(void)
-{
- return migration_colo_enabled;
-}
-
void migration_incoming_disable_colo(void)
{
ram_block_discard_disable(false);
@@ -739,7 +734,7 @@ static void process_incoming_migration_bh(void *opaque)
} else {
runstate_set(RUN_STATE_PAUSED);
}
- } else if (migration_incoming_colo_enabled()) {
+ } else if (migrate_colo()) {
migration_incoming_disable_colo();
vm_start();
} else {
@@ -807,7 +802,7 @@ process_incoming_migration_co(void *opaque)
goto fail;
}
- if (migration_incoming_colo_enabled()) {
+ if (migrate_colo()) {
/* yield until COLO exit */
colo_incoming_co();
}
diff --git a/migration/ram.c b/migration/ram.c
index fc7ece2c1a10f34aa5a91f58cbe42ea418d7c078..aebf77aa0b861e00516d6f1090aebefdd0d97e54 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -4370,7 +4370,7 @@ static int ram_load_precopy(QEMUFile *f)
* speed of the migration, but it obviously reduce the downtime of
* back-up all SVM'S memory in COLO preparing stage.
*/
- if (migration_incoming_colo_enabled()) {
+ if (migrate_colo()) {
if (migration_incoming_in_colo_state()) {
/* In COLO stage, put all pages into cache temporarily */
host = colo_cache_from_block_offset(block, addr, true);
--
2.39.5
next prev parent reply other threads:[~2026-02-18 21:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-18 21:29 [PATCH v9 00/19] migration: Add COLO multifd support and COLO migration unit test Lukas Straub
2026-02-18 21:29 ` [PATCH v9 01/19] MAINTAINERS: Add myself as maintainer for COLO migration framework Lukas Straub
2026-02-18 21:29 ` [PATCH v9 02/19] MAINTAINERS: Remove Hailiang Zhang from " Lukas Straub
2026-02-18 21:29 ` [PATCH v9 03/19] colo: Setup ram cache in normal migration path Lukas Straub
2026-02-18 21:29 ` Lukas Straub [this message]
2026-02-18 21:29 ` [PATCH v9 05/19] colo: Remove ENABLE_COLO savevm command and mark it as deprecated Lukas Straub
2026-02-18 21:29 ` [PATCH v9 06/19] ram: Remove colo special-casing Lukas Straub
2026-02-18 21:29 ` [PATCH v9 07/19] multifd: Move ram state receive into multifd_ram_state_recv() Lukas Straub
2026-02-18 21:29 ` [PATCH v9 08/19] multifd: Add COLO support Lukas Straub
2026-02-18 21:29 ` [PATCH v9 09/19] Call colo_release_ram_cache() after multifd threads terminate Lukas Straub
2026-02-18 21:29 ` [PATCH v9 10/19] colo: Fix crash during device vmstate load Lukas Straub
2026-02-18 21:29 ` [PATCH v9 11/19] colo: Hold the BQL while sending ram state Lukas Straub
2026-02-18 21:29 ` [PATCH v9 12/19] colo: Do not hold the BQL while receiving " Lukas Straub
2026-02-18 21:29 ` [PATCH v9 13/19] migration-test: Add COLO migration unit test Lukas Straub
2026-02-18 21:29 ` [PATCH v9 14/19] Convert colo main documentation to restructuredText Lukas Straub
2026-02-18 21:29 ` [PATCH v9 15/19] qemu-colo.rst: Miscellaneous changes Lukas Straub
2026-02-18 21:29 ` [PATCH v9 16/19] qemu-colo.rst: Add my copyright Lukas Straub
2026-02-18 21:29 ` [PATCH v9 17/19] qemu-colo.rst: Simplify the block replication setup Lukas Straub
2026-02-18 21:29 ` [PATCH v9 18/19] multifd: Fix hang if send thread errors during sync Lukas Straub
2026-02-19 21:23 ` Peter Xu
2026-02-18 21:29 ` [PATCH v9 19/19] colo: Fix a rare crash during shutdown Lukas Straub
2026-02-19 21:33 ` Peter Xu
2026-02-26 10:43 ` Lukas Straub
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260218-colo_unit_test_multifd-v9-4-d8dbdb0ca6f6@web.de \
--to=lukasstraub2@web.de \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=farosas@suse.de \
--cc=lizhijian@fujitsu.com \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhangckid@gmail.com \
--cc=zhanghailiang@xfusion.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.