From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A4EEEC44508 for ; Wed, 21 Jan 2026 19:39:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vie22-00065p-5i; Wed, 21 Jan 2026 14:38:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vie21-00064Q-22 for qemu-devel@nongnu.org; Wed, 21 Jan 2026 14:38:21 -0500 Received: from mout.web.de ([212.227.17.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vie1y-0006BC-1Q for qemu-devel@nongnu.org; Wed, 21 Jan 2026 14:38:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1769024291; x=1769629091; i=lukasstraub2@web.de; bh=hwyDnKbggR7MWJK7HDXJhmXSQ2kD2fLDHMjqLGR3i3A=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:Message-ID:In-Reply-To: References:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=S+iH9Fxh6ZBUdjYyTRpJhYlbagccznQTVXFdXdxC4KG6P3NB/zpwC4Mn1p6NhG2r T8450YnGpqkPn8WET00QuXB5fHy4qE7yGYk1OesFcYdLxILvBgo3J78HdHsKNdEvv THL96bAwWRGVAmGn4BEFnLtdYTLVdWg3yHsv7GF1tgMe011mUjrjuJj2EHLeQxrot IUhc+Ur3OdQFUER1Eum+vmMwbaGj6863RrKIjBoF4BO4TB9eOAVXn9W+bYG7fmiun YTROAXV+Acd/fKmDDLus86/bC2+xflDFPySsPTGygCb05vFYtFjMhgPb+9oa24kWt BdmKANrf14nfRZNqiw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from penguin ([217.247.100.70]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M8kEV-1vdzCU2RmL-00DPEl; Wed, 21 Jan 2026 20:38:11 +0100 Date: Wed, 21 Jan 2026 20:37:51 +0100 From: Lukas Straub To: Peter Xu Cc: qemu-devel@nongnu.org, Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Zhang Chen , Hailiang Zhang , Markus Armbruster Subject: Re: [PATCH v2 5/8] migration-test: Add COLO migration unit test Message-ID: <20260121203751.6bc9027d@penguin> In-Reply-To: References: <20260117-colo_unit_test_multifd-v2-0-ab521777fa51@web.de> <20260117-colo_unit_test_multifd-v2-5-ab521777fa51@web.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/b=sOcAe.VQ.DHUzIVsQtwAG"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Provags-ID: V03:K1:x5eu539hJGPNFTmJBTtVdoGtz0c4sNDpsrl6lOjN0zKBCKBAxl8 8gYdrdNnx4lHkUo8k7i+2EDYlQedgUxUFCOQ6/raGlo3MpcVmDsI36MoCaT81xL9KAn1/Cj NahNG5u+hByutmB93lYilYc00NmcI9887rpG/ChqMdUg1tF6RsyqRsQ/seBJU/JUFBGAHE7 d3K9xeqFEV5s/jxUUBPjA== UI-OutboundReport: notjunk:1;M01:P0:6Q3ihWP3WWU=;fq+tE+FNor7hNuKWb0sM6QUktlI 7KNlHbdJBHi0r11axDvA1dAzIEV5mG2JZmnm6D03x3487BkdLvcClt1lkTuMMUiaj67Er2eHy tmenSpo+OjtcUbHXVW+IpVqKxyxVL0Tp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spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --Sig_/b=sOcAe.VQ.DHUzIVsQtwAG Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 20 Jan 2026 12:23:08 -0500 Peter Xu wrote: > On Sat, Jan 17, 2026 at 03:09:12PM +0100, Lukas Straub wrote: > > Add a COLO migration test for COLO migration and failover. > >=20 > > COLO does not support q35 machine at this time. > >=20 > > Signed-off-by: Lukas Straub > > --- > > MAINTAINERS | 1 + > > tests/qtest/meson.build | 7 ++- > > tests/qtest/migration-test.c | 1 + > > tests/qtest/migration/colo-tests.c | 113 +++++++++++++++++++++++++++++= ++++++++ > > tests/qtest/migration/framework.c | 87 +++++++++++++++++++++++++++- > > tests/qtest/migration/framework.h | 10 ++++ > > 6 files changed, 217 insertions(+), 2 deletions(-) > >=20 > > diff --git a/MAINTAINERS b/MAINTAINERS > > index dbb217255c2cf35dc0ce971c2021b130fac5469b..92ca20c9d4186a08519d15b= fe8cbd583ab061a8b 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -3840,6 +3840,7 @@ F: migration/colo* > > F: migration/multifd-colo.* > > F: include/migration/colo.h > > F: include/migration/failover.h > > +F: tests/qtest/migration/colo-tests.c > > F: docs/COLO-FT.txt > > =20 > > COLO Proxy > > diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build > > index 0f053fb56de5806d3c213e3a26c0b19998ae151a..d0129af4431bb08a94a918a= 1e40a8f657059d764 100644 > > --- a/tests/qtest/meson.build > > +++ b/tests/qtest/meson.build > > @@ -367,6 +367,11 @@ if gnutls.found() > > endif > > endif > > =20 > > +migration_colo_files =3D [] > > +if get_option('replication').allowed() > > + migration_colo_files =3D [files('migration/colo-tests.c')] > > +endif > > + > > qtests =3D { > > 'aspeed_hace-test': files('aspeed-hace-utils.c', 'aspeed_hace-test.c= '), > > 'aspeed_smc-test': files('aspeed-smc-utils.c', 'aspeed_smc-test.c'), > > @@ -378,7 +383,7 @@ qtests =3D { > > 'migration/migration-util.c') + dbus_vmst= ate1, > > 'erst-test': files('erst-test.c'), > > 'ivshmem-test': [rt, '../../contrib/ivshmem-server/ivshmem-server.c'= ], > > - 'migration-test': test_migration_files + migration_tls_files, > > + 'migration-test': test_migration_files + migration_tls_files + migra= tion_colo_files, > > 'pxe-test': files('boot-sector.c'), > > 'pnv-xive2-test': files('pnv-xive2-common.c', 'pnv-xive2-flush-sync.= c', > > 'pnv-xive2-nvpg_bar.c'), > > diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c > > index 08936871741535c926eeac40a7d7c3f461c72fd0..e582f05c7dc2673dbd05a93= 6df8feb6c964b5bbc 100644 > > --- a/tests/qtest/migration-test.c > > +++ b/tests/qtest/migration-test.c > > @@ -55,6 +55,7 @@ int main(int argc, char **argv) > > migration_test_add_precopy(env); > > migration_test_add_cpr(env); > > migration_test_add_misc(env); > > + migration_test_add_colo(env); > > =20 > > ret =3D g_test_run(); > > =20 > > diff --git a/tests/qtest/migration/colo-tests.c b/tests/qtest/migration= /colo-tests.c > > new file mode 100644 > > index 0000000000000000000000000000000000000000..5004f581e4d9e4e6f54eee6= d70a9307b7fd123be > > --- /dev/null > > +++ b/tests/qtest/migration/colo-tests.c > > @@ -0,0 +1,113 @@ > > +/* > > + * SPDX-License-Identifier: GPL-2.0-or-later > > + * > > + * QTest testcases for COLO migration > > + * > > + * Copyright (c) 2025 Lukas Straub > > + * > > + * This work is licensed under the terms of the GNU GPL, version 2 or = later. > > + * See the COPYING file in the top-level directory. > > + * > > + */ > > + > > +#include "qemu/osdep.h" > > +#include "libqtest.h" > > +#include "migration/framework.h" > > +#include "migration/migration-qmp.h" > > +#include "migration/migration-util.h" > > +#include "qemu/module.h" > > + > > +static void test_colo_plain_common(MigrateCommon *args, > > + bool failover_during_checkpoint, > > + bool primary_failover) > > +{ > > + args->listen_uri =3D "tcp:127.0.0.1:0"; > > + test_colo_common(args, failover_during_checkpoint, primary_failove= r); > > +} > > + > > +static void *hook_start_multifd(QTestState *from, QTestState *to) > > +{ > > + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "no= ne"); > > +} > > + > > +static void test_colo_multifd_common(MigrateCommon *args, > > + bool failover_during_checkpoint, > > + bool primary_failover) > > +{ > > + args->listen_uri =3D "defer"; > > + args->start_hook =3D hook_start_multifd; > > + args->start.caps[MIGRATION_CAPABILITY_MULTIFD] =3D true; > > + test_colo_common(args, failover_during_checkpoint, primary_failove= r); > > +} > > + > > +static void test_colo_plain_primary_failover(char *name, MigrateCommon= *args) > > +{ > > + test_colo_plain_common(args, false, true); > > +} > > + > > +static void test_colo_plain_secondary_failover(char *name, MigrateComm= on *args) > > +{ > > + test_colo_plain_common(args, false, false); > > +} > > + > > +static void test_colo_multifd_primary_failover(char *name, MigrateComm= on *args) > > +{ > > + test_colo_multifd_common(args, false, true); > > +} > > + > > +static void test_colo_multifd_secondary_failover(char *name, > > + MigrateCommon *args) > > +{ > > + test_colo_multifd_common(args, false, false); > > +} > > + > > +static void test_colo_plain_primary_failover_checkpoint(char *name, > > + MigrateCommon = *args) > > +{ > > + test_colo_plain_common(args, true, true); > > +} > > + > > +static void test_colo_plain_secondary_failover_checkpoint(char *name, > > + MigrateCommo= n *args) > > +{ > > + test_colo_plain_common(args, true, false); > > +} > > + > > +static void test_colo_multifd_primary_failover_checkpoint(char *name, > > + MigrateCommo= n *args) > > +{ > > + test_colo_multifd_common(args, true, true); > > +} > > + > > +static void test_colo_multifd_secondary_failover_checkpoint(char *name, > > + MigrateCom= mon *args) > > +{ > > + test_colo_multifd_common(args, true, false); > > +} > > + > > +void migration_test_add_colo(MigrationTestEnv *env) > > +{ > > + if (!env->full_set) { > > + return; > > + } > > + > > + migration_test_add("/migration/colo/plain/primary_failover", > > + test_colo_plain_primary_failover); > > + migration_test_add("/migration/colo/plain/secondary_failover", > > + test_colo_plain_secondary_failover); > > + > > + migration_test_add("/migration/colo/multifd/primary_failover", > > + test_colo_multifd_primary_failover); > > + migration_test_add("/migration/colo/multifd/secondary_failover", > > + test_colo_multifd_secondary_failover); > > + > > + migration_test_add("/migration/colo/plain/primary_failover_checkpo= int", > > + test_colo_plain_primary_failover_checkpoint); > > + migration_test_add("/migration/colo/plain/secondary_failover_check= point", > > + test_colo_plain_secondary_failover_checkpoint); > > + > > + migration_test_add("/migration/colo/multifd/primary_failover_check= point", > > + test_colo_multifd_primary_failover_checkpoint); > > + migration_test_add("/migration/colo/multifd/secondary_failover_che= ckpoint", > > + test_colo_multifd_secondary_failover_checkpoint= ); > > +} > > diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/= framework.c > > index 57d3b9b7c5a269d31659971e308367bd916d28f6..fe34e7cc7a1a4eeb8d5219f= 54733bbd8446b0e4e 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") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D= 0) { > > memory_size =3D "150M"; > > =20 > > - if (g_str_equal(arch, "i386")) { > > + if (g_str_equal(arch, "i386") || args->force_pc_machine) { =20 >=20 > The naming is better, thanks. Said that, force_pc_machine is unwanted > either.. if we can drop it. I asked this in v1: >=20 > https://lore.kernel.org/qemu-devel/aWltRH6Nra-Tji7w@x1.local/ >=20 > Can we explore that possibility? Never mind. I found the issue and will remove this in the next version. >=20 > > machine_alias =3D "pc"; > > } else { > > machine_alias =3D "q35"; > > @@ -1066,6 +1066,91 @@ void *migrate_hook_start_precopy_tcp_multifd_com= mon(QTestState *from, > > return NULL; > > } > > =20 > > +int test_colo_common(MigrateCommon *args, bool failover_during_checkpo= int, > > + bool primary_failover) > > +{ > > + QTestState *from, *to; > > + void *data_hook =3D NULL; > > + > > + /* > > + * For the COLO test, both VMs will run in parallel. Thus both VMs= want to > > + * open the image read/write at the same time. Using read-only=3Do= n is not > > + * possible here, because ide-hd does not support read-only backin= g image. > > + * > > + * So use -snapshot, where each qemu instance creates its own writ= able > > + * snapshot internally while leaving the real image read-only. > > + */ > > + args->start.opts_source =3D "-snapshot"; > > + args->start.opts_target =3D "-snapshot"; > > + > > + /* > > + * COLO migration code logs many errors when the migration socket > > + * is shut down, these are expected so we hide them here. > > + */ > > + args->start.hide_stderr =3D true; > > + > > + /* > > + * COLO currently does not work with Q35 machine > > + */ > > + args->start.force_pc_machine =3D true; > > + > > + args->start.oob =3D true; =20 >=20 > Just curious: is OOB required in COLO for some reason? I understand yank > you used below uses OOB, so the question is behind that, on what can be > blocked in main thread, and special in COLO. >=20 > > + args->start.caps[MIGRATION_CAPABILITY_X_COLO] =3D 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 =3D 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); =20 >=20 > We can move this whole function into colo-tests.c. Here you may want to > use get_dst() instead. Okey, will do that. >=20 > > + > > + wait_for_serial("src_serial"); > > + wait_for_serial("dest_serial"); > > + > > + /* wait for 3 checkpoints */ > > + for (int i =3D 0; i < 3; i++) { > > + qtest_qmp_eventwait(to, "RESUME"); > > + wait_for_serial("src_serial"); > > + wait_for_serial("dest_serial"); > > + } > > + > > + if (failover_during_checkpoint) { > > + qtest_qmp_eventwait(to, "STOP"); > > + } > > + if (primary_failover) { > > + qtest_qmp_assert_success(from, "{'exec-oob': 'yank', 'id': 'ya= nk-cmd', " > > + "'arguments': {'instances'= :" > > + "[{'type': 'migration'= }]}}"); > > + qtest_qmp_assert_success(from, "{'execute': 'x-colo-lost-heart= beat'}"); > > + 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-heartbe= at'}"); > > + wait_for_serial("dest_serial"); > > + } > > + > > + if (args->end_hook) { > > + args->end_hook(from, to, data_hook); > > + } > > + > > + migrate_end(from, to, !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 2ef0f57962605c9e3bc7b7de48e52351e5389138..75088c5fb098a0f95acb1e2= 3585d3b6e8307451e 100644 > > --- a/tests/qtest/migration/framework.h > > +++ b/tests/qtest/migration/framework.h > > @@ -139,6 +139,9 @@ typedef struct { > > /* Do not connect to target monitor and qtest sockets in qtest_ini= t */ > > bool defer_target_connect; > > =20 > > + /* Use pc machine for x86_64 */ > > + bool force_pc_machine; > > + > > /* > > * Migration capabilities to be set in both source and > > * destination. For unilateral capabilities, use > > @@ -248,6 +251,8 @@ 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, bool failover_during_checkpo= int, > > + bool colo_primary_failover); > > void *migrate_hook_start_precopy_tcp_multifd_common(QTestState *from, > > QTestState *to, > > const char *method= ); > > @@ -267,5 +272,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 > > =20 > > #endif /* TEST_FRAMEWORK_H */ > >=20 > > --=20 > > 2.39.5 > > =20 >=20 --Sig_/b=sOcAe.VQ.DHUzIVsQtwAG Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEg/qxWKDZuPtyYo+kNasLKJxdslgFAmlxKw8ACgkQNasLKJxd slj21g//SOVAw/w8BTitzT95EWy0BgaEFxXhF4TKp8Uix5fNNwdVKijxjLq3VYH3 Pyf4ZopJIgbVzf8/g+qw2klsAX99oaJDgxl0ujUwQI9x7IL7QTJAQOf6EwnhgIXN yIozkZP792FxvCBmCqhFqHsh5Q2GWZVlgu9GuqRfSDniycy4E/12RdA2DHZ9gsvJ chjq6xXjuq21idipCwjctdrY20Bj6ga8KsXrguBYvuDPPDW1a4GyRZBA4LZju8ox uaEk/+8pd9yyul9ojdhq1Sjov/Pd21KFvosC1TZABYR7tryUYY1fcDPXwJlZCI70 Iyvsb6Hmr9/8zG8yIp9ltCyfbvsCXxASHUR/aOmRdRKcufL/2yemxBak4fDFVeTE OUFYiL6oZMX7gbTEIdeyjp0FbY6/5IBKXA3OPjePFZ/3IZ7lisqJjpOAZy8TAHVH p4L2MEE96jEvmWxXbjcqg3t+zAJL8cU0Ke8Z7bSDKlDN2Wm5l1eqequcscC+X1uC h3EgOe1E1BunUvNaLr92e/7aDpJGVM8RjhYg12uQxDaWBABAgVINhtNIG5IZm3dn Eie2E1hsHE25rR6HSoGUbLNACKx9bfY6VG8qBbYNIXAj0sauEUncF4Eaiq3kk02V fJ5BBbYSEf3ObOUXvYwJomWgG7JXfHKBVKzhG+IvdYb6b4obfoE= =4M17 -----END PGP SIGNATURE----- --Sig_/b=sOcAe.VQ.DHUzIVsQtwAG--