From: Lukas Straub <lukasstraub2@web.de>
To: Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Zhang Chen <zhangckid@gmail.com>
Subject: Re: [PATCH 3/3] migration-test: Add COLO migration unit test
Date: Thu, 15 Jan 2026 23:35:00 +0100 [thread overview]
Message-ID: <20260115233500.26fd1628@penguin> (raw)
In-Reply-To: <aV1qf5uDYYiGrqR_@x1.local>
[-- Attachment #1: Type: text/plain, Size: 7801 bytes --]
On Tue, 6 Jan 2026 15:03:11 -0500
Peter Xu <peterx@redhat.com> wrote:
> On Tue, Dec 30, 2025 at 03:05:46PM +0100, Lukas Straub wrote:
> > Add a COLO migration test for COLO migration and failover.
> >
> > COLO does not support q35 machine at this time.
> >
> > Signed-off-by: Lukas Straub <lukasstraub2@web.de>
> > ---
> > tests/qtest/meson.build | 7 ++-
> > tests/qtest/migration-test.c | 1 +
> > tests/qtest/migration/colo-tests.c | 115 +++++++++++++++++++++++++++++++++++++
> > tests/qtest/migration/framework.c | 65 ++++++++++++++++++++-
> > tests/qtest/migration/framework.h | 9 +++
> > 5 files changed, 195 insertions(+), 2 deletions(-)
> >
> > [...]
> > +
> > +void migration_test_add_colo(MigrationTestEnv *env)
> > +{
> > + migration_test_add("/migration/colo/plain/secondary_failover",
> > + test_colo_plain_secondary_failover);
> > +
> > + migration_test_add("/migration/colo/multifd/secondary_failover",
> > + test_colo_multifd_secondary_failover);
> > +
> > + if (!env->full_set) {
> > + return;
> > + }
>
> IMHO we can skip all COLO tests in full_set. Don't worry, if it's merged
> at least Fabiano and myself will always run it, making sure migration
> patches will be smoked.
>
> Here it's about whether we will run it in everyone's CI.
Okay, I will fix this in the next version.
>
> > +
> > + migration_test_add("/migration/colo/plain/primary_failover",
> > + test_colo_plain_primary_failover);
> > +
> > + migration_test_add("/migration/colo/multifd/primary_failover",
> > + test_colo_multifd_primary_failover);
> > +
> > + migration_test_add("/migration/colo/plain/primary_failover_checkpoint",
> > + test_colo_plain_primary_failover_checkpoint);
> > + migration_test_add("/migration/colo/plain/secondary_failover_checkpoint",
> > + test_colo_plain_secondary_failover_checkpoint);
> > +
> > + migration_test_add("/migration/colo/multifd/primary_failover_checkpoint",
> > + test_colo_multifd_primary_failover_checkpoint);
> > + migration_test_add("/migration/colo/multifd/secondary_failover_checkpoint",
> > + test_colo_multifd_secondary_failover_checkpoint);
> > +}
> > diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/framework.c
> > index 8c1fc6e009f16dc05a47e917167f62e0250ca992..08bca49a8980f9988be9447acf54b17acd56da94 100644
> > --- a/tests/qtest/migration/framework.c
> > +++ b/tests/qtest/migration/framework.c
> > @@ -315,7 +315,7 @@ int migrate_args(char **from, char **to, const char *uri, MigrateStart *args)
> > if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
> > memory_size = "150M";
> >
> > - if (g_str_equal(arch, "i386")) {
> > + if (g_str_equal(arch, "i386") || args->is_colo) {
>
> OK, one more reference..
>
> I'm curious, why Q35 is not supported?
There is a bug in the emulated ahci disk controller which crashes when
it's vmstate is loaded more than once.
>
> > machine_alias = "pc";
> > } else {
> > machine_alias = "q35";
> > @@ -1068,6 +1068,69 @@ void *migrate_hook_start_precopy_tcp_multifd_common(QTestState *from,
> > return NULL;
> > }
> >
> > +int test_colo_common(MigrateCommon *args)
> > +{
> > + QTestState *from, *to;
> > + void *data_hook = NULL;
> > +
> > + args->start.oob = true;
> > + args->start.is_colo = true;
> > + args->start.caps[MIGRATION_CAPABILITY_X_COLO] = true;
> > +
> > + if (migrate_start(&from, &to, args->listen_uri, &args->start)) {
> > + return -1;
> > + }
> > +
> > + migrate_set_parameter_int(from, "x-checkpoint-delay", 300);
> > +
> > + if (args->start_hook) {
> > + data_hook = args->start_hook(from, to);
> > + }
> > +
> > + migrate_ensure_converge(from);
> > + wait_for_serial("src_serial");
> > +
> > + migrate_qmp(from, to, args->connect_uri, NULL, "{}");
> > +
> > + wait_for_migration_status(from, "colo", NULL);
> > + wait_for_resume(to, &dst_state);
> > +
> > + wait_for_serial("src_serial");
> > + wait_for_serial("dest_serial");
> > +
> > + /* wait for 3 checkpoints */
> > + for (int i = 0; i < 3; i++) {
> > + qtest_qmp_eventwait(to, "RESUME");
> > + wait_for_serial("src_serial");
> > + wait_for_serial("dest_serial");
> > + }
> > +
> > + if (args->colo_failover_during_checkpoint) {
> > + qtest_qmp_eventwait(to, "STOP");
> > + }
> > + if (args->colo_primary_failover) {
> > + qtest_qmp_assert_success(from, "{'exec-oob': 'yank', 'id': 'yank-cmd', "
> > + "'arguments': {'instances':"
> > + "[{'type': 'migration'}]}}");
> > + qtest_qmp_assert_success(from, "{'execute': 'x-colo-lost-heartbeat'}");
> > + wait_for_serial("src_serial");
> > + } else {
> > + qtest_qmp_assert_success(to, "{'exec-oob': 'yank', 'id': 'yank-cmd', "
> > + "'arguments': {'instances':"
> > + "[{'type': 'migration'}]}}");
> > + qtest_qmp_assert_success(to, "{'execute': 'x-colo-lost-heartbeat'}");
> > + wait_for_serial("dest_serial");
> > + }
> > +
> > + if (args->end_hook) {
> > + args->end_hook(from, to, data_hook);
> > + }
> > +
> > + migrate_end(from, to, !args->colo_primary_failover);
> > +
> > + return 0;
> > +}
> > +
> > QTestMigrationState *get_src(void)
> > {
> > return &src_state;
> > diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/framework.h
> > index 2ea13e7758697550b5531737e66d6d939dd800d1..1da532569d8c5941c99d83ae7da88ccab2bdcbe2 100644
> > --- a/tests/qtest/migration/framework.h
> > +++ b/tests/qtest/migration/framework.h
> > @@ -230,6 +230,9 @@ typedef struct {
> > */
> > bool live;
> >
> > + bool colo_primary_failover;
> > + bool colo_failover_during_checkpoint;
>
> Let's try to not add more per-feature fields here into the test framework
> struct. My bad to have started doing this for postcopy tests.. I'll
> prepare patches to remove the postcopy ones. These parameters can be
> passed from the test callers, afaict.
>
> Thanks,
>
> > +
> > /* Postcopy specific fields */
> > void *postcopy_data;
> > PostcopyRecoveryFailStage postcopy_recovery_fail_stage;
> > @@ -248,6 +251,7 @@ void test_postcopy_common(MigrateCommon *args);
> > void test_postcopy_recovery_common(MigrateCommon *args);
> > int test_precopy_common(MigrateCommon *args);
> > void test_file_common(MigrateCommon *args, bool stop_src);
> > +int test_colo_common(MigrateCommon *args);
> > void *migrate_hook_start_precopy_tcp_multifd_common(QTestState *from,
> > QTestState *to,
> > const char *method);
> > @@ -267,5 +271,10 @@ void migration_test_add_file(MigrationTestEnv *env);
> > void migration_test_add_precopy(MigrationTestEnv *env);
> > void migration_test_add_cpr(MigrationTestEnv *env);
> > void migration_test_add_misc(MigrationTestEnv *env);
> > +#ifdef CONFIG_REPLICATION
> > +void migration_test_add_colo(MigrationTestEnv *env);
> > +#else
> > +static inline void migration_test_add_colo(MigrationTestEnv *env) {};
> > +#endif
> >
> > #endif /* TEST_FRAMEWORK_H */
> >
> > --
> > 2.39.5
> >
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-01-15 22:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-30 14:05 [PATCH 0/3] migration: Add COLO multifd support and COLO migration unit test Lukas Straub
2025-12-30 14:05 ` [PATCH 1/3] multifd: Add colo support Lukas Straub
2026-01-06 19:54 ` Peter Xu
2026-01-15 22:43 ` Lukas Straub
2025-12-30 14:05 ` [PATCH 2/3] migration-test: Add -snapshot option for COLO Lukas Straub
2026-01-06 19:55 ` Peter Xu
2026-01-15 22:37 ` Lukas Straub
2025-12-30 14:05 ` [PATCH 3/3] migration-test: Add COLO migration unit test Lukas Straub
2026-01-06 20:03 ` Peter Xu
2026-01-15 22:35 ` Lukas Straub [this message]
2026-01-15 22:42 ` Peter Xu
2025-12-30 15:02 ` [PATCH 0/3] migration: Add COLO multifd support and " Peter Xu
2026-01-04 5:44 ` Zhang Chen
2026-01-04 5:48 ` Zhang Chen
2026-01-06 19:48 ` Peter Xu
2026-01-15 21:45 ` Lukas Straub
2026-01-06 20:05 ` Peter Xu
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=20260115233500.26fd1628@penguin \
--to=lukasstraub2@web.de \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhangckid@gmail.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.