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 05/19] colo: Remove ENABLE_COLO savevm command and mark it as deprecated
Date: Wed, 18 Feb 2026 22:29:25 +0100 [thread overview]
Message-ID: <20260218-colo_unit_test_multifd-v9-5-d8dbdb0ca6f6@web.de> (raw)
In-Reply-To: <20260218-colo_unit_test_multifd-v9-0-d8dbdb0ca6f6@web.de>
No need for it anymore now that x-colo capability is required
on incoming side. There is also no need to send it for backwards
compatibility since we only support COLO with the same version on
both sides.
We mark the command code as deprecated and now error out if such
a unhandled command is encountered in loadvm_process_command().
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Lukas Straub <lukasstraub2@web.de>
---
include/migration/colo.h | 2 --
migration/migration.c | 31 -------------------------------
migration/savevm.c | 25 +++++--------------------
migration/savevm.h | 1 -
migration/trace-events | 1 -
5 files changed, 5 insertions(+), 55 deletions(-)
diff --git a/include/migration/colo.h b/include/migration/colo.h
index 2496a968cc1ce709f706c0efe57e4f765f163d3c..8f94054a10760d0f2598f080643f45f9944cf051 100644
--- a/include/migration/colo.h
+++ b/include/migration/colo.h
@@ -25,8 +25,6 @@ void migrate_start_colo_process(MigrationState *s);
bool migration_in_colo_state(void);
/* loadvm */
-int migration_incoming_enable_colo(Error **errp);
-void migration_incoming_disable_colo(void);
bool migration_incoming_in_colo_state(void);
COLOMode get_colo_mode(void);
diff --git a/migration/migration.c b/migration/migration.c
index ef6aac53343f2217cd1aa37e493483703068d1ff..dba5d6ede579da42693d5270ede9660fb145238a 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -604,31 +604,6 @@ int migrate_send_rp_req_pages(MigrationIncomingState *mis,
return migrate_send_rp_message_req_pages(mis, rb, start);
}
-static bool migration_colo_enabled;
-void migration_incoming_disable_colo(void)
-{
- ram_block_discard_disable(false);
- migration_colo_enabled = false;
-}
-
-int migration_incoming_enable_colo(Error **errp)
-{
-#ifndef CONFIG_REPLICATION
- error_setg(errp, "ENABLE_COLO command come in migration stream, but the "
- "replication module is not built in");
- return -ENOTSUP;
-#endif
-
- if (!migrate_colo()) {
- error_setg(errp, "ENABLE_COLO command come in migration stream"
- ", but x-colo capability is not set");
- return -EINVAL;
- }
-
- migration_colo_enabled = true;
- return 0;
-}
-
void migrate_add_address(SocketAddress *address)
{
MigrationIncomingState *mis = migration_incoming_get_current();
@@ -735,7 +710,6 @@ static void process_incoming_migration_bh(void *opaque)
runstate_set(RUN_STATE_PAUSED);
}
} else if (migrate_colo()) {
- migration_incoming_disable_colo();
vm_start();
} else {
runstate_set(global_state_get_runstate());
@@ -3534,11 +3508,6 @@ static void *migration_thread(void *opaque)
qemu_savevm_send_postcopy_advise(s->to_dst_file);
}
- if (migrate_colo()) {
- /* Notify migration destination that we enable COLO */
- qemu_savevm_send_colo_enable(s->to_dst_file);
- }
-
if (migrate_auto_converge()) {
/* Start RAMBlock dirty bitmap sync timer */
cpu_throttle_dirty_sync_timer(true);
diff --git a/migration/savevm.c b/migration/savevm.c
index b88851cdb7974314b8481646a1dd19642887f210..197c89e0e659b889409c3dc97518920ea9c1824f 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -90,7 +90,7 @@ enum qemu_vm_cmd {
were previously sent during
precopy but are dirty. */
MIG_CMD_PACKAGED, /* Send a wrapped stream within this stream */
- MIG_CMD_ENABLE_COLO, /* Enable COLO */
+ MIG_CMD_DEPRECATED_0, /* Prior to 10.2, used as MIG_CMD_ENABLE_COLO */
MIG_CMD_POSTCOPY_RESUME, /* resume postcopy on dest */
MIG_CMD_RECV_BITMAP, /* Request for recved bitmap on dst */
MIG_CMD_SWITCHOVER_START, /* Switchover start notification */
@@ -1103,12 +1103,6 @@ static void qemu_savevm_command_send(QEMUFile *f,
qemu_fflush(f);
}
-void qemu_savevm_send_colo_enable(QEMUFile *f)
-{
- trace_savevm_send_colo_enable();
- qemu_savevm_command_send(f, MIG_CMD_ENABLE_COLO, 0, NULL);
-}
-
void qemu_savevm_send_ping(QEMUFile *f, uint32_t value)
{
uint32_t buf;
@@ -2423,13 +2417,6 @@ static int loadvm_handle_recv_bitmap(MigrationIncomingState *mis,
return 0;
}
-static int loadvm_process_enable_colo(MigrationIncomingState *mis,
- Error **errp)
-{
- ERRP_GUARD();
- return migration_incoming_enable_colo(errp);
-}
-
static int loadvm_postcopy_handle_switchover_start(Error **errp)
{
SaveStateEntry *se;
@@ -2513,7 +2500,7 @@ static int loadvm_process_command(QEMUFile *f, Error **errp)
return ret;
}
}
- break;
+ return 0;
case MIG_CMD_PING:
tmp32 = qemu_get_be32(f);
@@ -2524,7 +2511,7 @@ static int loadvm_process_command(QEMUFile *f, Error **errp)
return -1;
}
migrate_send_rp_pong(mis, tmp32);
- break;
+ return 0;
case MIG_CMD_PACKAGED:
return loadvm_handle_cmd_packaged(mis, errp);
@@ -2548,14 +2535,12 @@ static int loadvm_process_command(QEMUFile *f, Error **errp)
case MIG_CMD_RECV_BITMAP:
return loadvm_handle_recv_bitmap(mis, len, errp);
- case MIG_CMD_ENABLE_COLO:
- return loadvm_process_enable_colo(mis, errp);
-
case MIG_CMD_SWITCHOVER_START:
return loadvm_postcopy_handle_switchover_start(errp);
}
- return 0;
+ error_setg(errp, "MIG_CMD 0x%x deprecated (len 0x%x)", cmd, len);
+ return -EINVAL;
}
/*
diff --git a/migration/savevm.h b/migration/savevm.h
index 2ba0881f3bd28dba10e52e16657a0b67b19bb00b..b3d1e8a13ca9a535a6990560ed2d64739ebe730e 100644
--- a/migration/savevm.h
+++ b/migration/savevm.h
@@ -65,7 +65,6 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name,
uint16_t len,
uint64_t *start_list,
uint64_t *length_list);
-void qemu_savevm_send_colo_enable(QEMUFile *f);
int qemu_save_device_state(QEMUFile *f, Error **errp);
int qemu_loadvm_state(QEMUFile *f, Error **errp);
void qemu_loadvm_state_cleanup(MigrationIncomingState *mis);
diff --git a/migration/trace-events b/migration/trace-events
index 90629f828f80b51500776ae2171724369e194573..60e5087e38beccb98588fdffec7deff9a7f92c88 100644
--- a/migration/trace-events
+++ b/migration/trace-events
@@ -37,7 +37,6 @@ savevm_send_ping(uint32_t val) "0x%x"
savevm_send_postcopy_listen(void) ""
savevm_send_postcopy_run(void) ""
savevm_send_postcopy_resume(void) ""
-savevm_send_colo_enable(void) ""
savevm_send_recv_bitmap(char *name) "%s"
savevm_send_switchover_start(void) ""
savevm_state_setup(void) ""
--
2.39.5
next prev parent reply other threads:[~2026-02-18 21:32 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 ` [PATCH v9 04/19] colo: Replace migration_incoming_colo_enabled() with migrate_colo() Lukas Straub
2026-02-18 21:29 ` Lukas Straub [this message]
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-5-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.