From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061797; cv=none; d=zohomail.com; s=zohoarc; b=MI9LFoqoFZEQ7ASD4Cgp1FHPWeY0HrrwFJNNS0/yiMd751cjR79jjjjpky2baSAhrDsDBR1MbP4zPk+Rv7OYl9myEH2YSRRR0d0FrVgPEXsCwxRHp3srzM34l3ySJbudYh0/HRCJ7yPEEMstbyWkNhQQSiwOAPrbw+ExgCBb/Ac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061797; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DI4CN1QY/8LqIY/V9/C3XgP4aivA7WCH9SmXXgY6CpE=; b=WQi2yAz/ImcrG5+MGIWZzpt0hoBKd8WpMnukDSuduPqlBvSMFjj/gwfiLGvxgy+Hifh7lj8M0oPjQbQ8sQFeH2I5ymHoHypY73VUz3ekX+VgzmKC0jiojRbaOv6Qn0kd6ieF5Wks5GEp/+Mlk2XkW2HXCXReJYqoC8REV+w195E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061797645299.42741892449214; Mon, 9 Mar 2026 06:09:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaKw-0006ch-7M; Mon, 09 Mar 2026 09:07:54 -0400 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 1vzaKs-0006bw-1A for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:50 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaKo-00080O-SW for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:49 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E77584D21A; Mon, 9 Mar 2026 13:07:35 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B820A3EEF3; Mon, 9 Mar 2026 13:07:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id cCUUHxbGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061656; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DI4CN1QY/8LqIY/V9/C3XgP4aivA7WCH9SmXXgY6CpE=; b=GFrNyUEcYpdCLbQjYG7+u4Vgjs8l2NU3F1bWjnWU5XPTtoC3nTMJp91i08xgW/Bcmeflay v2qI023Go+WwWqqDWSpTh3jaQ+xqLeygdldvB9uyOI9J6IDUhnbHpwFCyuhZCjYcEH0+Y+ JMm/PTMlg7KI0grJ8s+ZqXc45TVVbRM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061656; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DI4CN1QY/8LqIY/V9/C3XgP4aivA7WCH9SmXXgY6CpE=; b=nFsdWhPte3SixI9xfGY4LLNt9578FbOgI5zKGdmiqxH834ZrpX3ikE3TL0es/YJYoH0SmZ gedNNed1CyW+qiDg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="RoN/DEZW"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=OgCa0WeS DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061655; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DI4CN1QY/8LqIY/V9/C3XgP4aivA7WCH9SmXXgY6CpE=; b=RoN/DEZWYTLKseTchVl93roSyBo6rlW3j3/QYMy0MDW59kqcF6kjh+GH+m/eYlMnHfhFqw UlYuqWQ47HzMOTQMQaSSG5l65YuqCePCGLHU5GqL9Y7j7dV8Rb6zvfzQJqN+Vci0c/Lml+ bl8MU6kyANcxQ0vhEPdvgOZncC26A5I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061655; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DI4CN1QY/8LqIY/V9/C3XgP4aivA7WCH9SmXXgY6CpE=; b=OgCa0WeSVxI6UEdQG/mLNaXY/9IWmhh7b+5QPz6Uk4fcnl1J+bYI2aWwWwTpGjLz0GXWvf UEC1i7PcnEKSoEDw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Prasad Pandit Subject: [PULL 01/22] migration: introduce MIGRATION_STATUS_FAILING Date: Mon, 9 Mar 2026 10:07:06 -0300 Message-ID: <20260309130730.20526-2-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,suse.de:email]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Spam-Score: -3.01 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: E77584D21A Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1773061800998154100 Content-Type: text/plain; charset="utf-8" From: Prasad Pandit When migration connection is broken, the QEMU and libvirtd(8) process on the source side receive TCP connection reset notification. QEMU sets the migration status to FAILED and proceeds to migration_cleanup(). Meanwhile, Libvirtd(8) sends a QMP command to migrate_set_capabilities(). The migration_cleanup() and qmp_migrate_set_capabilities() calls race with each other. When the latter is invoked first, since the migration is not running (FAILED), migration capabilities are reset to false, so during migration_cleanup() the QEMU process crashes with assertion failure. Introduce a new migration status FAILING and use it as an interim status when an error occurs. Once migration_cleanup() is done, it sets the migration status to FAILED. This helps to avoid the above race condition and ensuing failure. Interim status FAILING is set wherever the execution moves towards migration_cleanup(): - postcopy_start() - migration_thread() - migration_cleanup() - multifd_send_setup() - bg_migration_thread() - migration_completion() - migration_detect_error() - bg_migration_completion() - multifd_send_error_propagate() - migration_connect_error_propagate() The migration status finally moves to FAILED and reports an appropriate error to the user. Interim status FAILING is _NOT_ set in the following routines because they do not follow the migration_cleanup() path to the FAILED state: - cpr_exec_cb() - qemu_savevm_state() - postcopy_listen_thread() - process_incoming_migration_co() - multifd_recv_terminate_threads() - migration_channel_process_incoming() Reviewed-by: Peter Xu Signed-off-by: Prasad Pandit Link: https://lore.kernel.org/qemu-devel/20260224102547.226087-1-ppandit@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 32 +++++++++++++++++---------- migration/multifd.c | 4 ++-- qapi/migration.json | 9 +++++--- tests/qtest/migration/migration-qmp.c | 3 ++- tests/qtest/migration/precopy-tests.c | 3 ++- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index a5b0465ed3..e80774e89b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1016,6 +1016,7 @@ bool migration_is_running(void) case MIGRATION_STATUS_DEVICE: case MIGRATION_STATUS_WAIT_UNPLUG: case MIGRATION_STATUS_CANCELLING: + case MIGRATION_STATUS_FAILING: case MIGRATION_STATUS_COLO: return true; default: @@ -1158,6 +1159,7 @@ static void fill_source_migration_info(MigrationInfo = *info) case MIGRATION_STATUS_POSTCOPY_PAUSED: case MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP: case MIGRATION_STATUS_POSTCOPY_RECOVER: + case MIGRATION_STATUS_FAILING: /* TODO add some postcopy stats */ populate_time_info(info, s); populate_ram_info(info, s); @@ -1210,6 +1212,7 @@ static void fill_destination_migration_info(Migration= Info *info) case MIGRATION_STATUS_POSTCOPY_PAUSED: case MIGRATION_STATUS_POSTCOPY_RECOVER: case MIGRATION_STATUS_FAILED: + case MIGRATION_STATUS_FAILING: case MIGRATION_STATUS_COLO: info->has_status =3D true; break; @@ -1330,6 +1333,9 @@ static void migration_cleanup(MigrationState *s) if (s->state =3D=3D MIGRATION_STATUS_CANCELLING) { migrate_set_state(&s->state, MIGRATION_STATUS_CANCELLING, MIGRATION_STATUS_CANCELLED); + } else if (s->state =3D=3D MIGRATION_STATUS_FAILING) { + migrate_set_state(&s->state, MIGRATION_STATUS_FAILING, + MIGRATION_STATUS_FAILED); } =20 /* @@ -1387,7 +1393,7 @@ void migration_connect_error_propagate(MigrationState= *s, Error *error) =20 switch (current) { case MIGRATION_STATUS_SETUP: - next =3D MIGRATION_STATUS_FAILED; + next =3D MIGRATION_STATUS_FAILING; break; =20 case MIGRATION_STATUS_POSTCOPY_PAUSED: @@ -1401,9 +1407,10 @@ void migration_connect_error_propagate(MigrationStat= e *s, Error *error) break; =20 case MIGRATION_STATUS_CANCELLING: + case MIGRATION_STATUS_FAILING: /* - * Don't move out of CANCELLING, the only valid transition is to - * CANCELLED, at migration_cleanup(). + * Keep the current state, next transition is to be done + * in migration_cleanup(). */ break; =20 @@ -1553,6 +1560,7 @@ bool migration_has_failed(MigrationState *s) { return (s->state =3D=3D MIGRATION_STATUS_CANCELLING || s->state =3D=3D MIGRATION_STATUS_CANCELLED || + s->state =3D=3D MIGRATION_STATUS_FAILING || s->state =3D=3D MIGRATION_STATUS_FAILED); } =20 @@ -2479,7 +2487,7 @@ static int postcopy_start(MigrationState *ms, Error *= *errp) if (postcopy_preempt_establish_channel(ms)) { if (ms->state !=3D MIGRATION_STATUS_CANCELLING) { migrate_set_state(&ms->state, ms->state, - MIGRATION_STATUS_FAILED); + MIGRATION_STATUS_FAILING); } error_setg(errp, "%s: Failed to establish preempt channel", __func__); @@ -2642,7 +2650,7 @@ fail_closefb: qemu_fclose(fb); fail: if (ms->state !=3D MIGRATION_STATUS_CANCELLING) { - migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED); + migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILING); } bql_unlock(); return -1; @@ -2833,7 +2841,7 @@ fail: } =20 if (s->state !=3D MIGRATION_STATUS_CANCELLING) { - migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED); + migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILING); } } =20 @@ -2870,7 +2878,7 @@ static void bg_migration_completion(MigrationState *s) =20 fail: migrate_set_state(&s->state, current_active_state, - MIGRATION_STATUS_FAILED); + MIGRATION_STATUS_FAILING); } =20 typedef enum MigThrError { @@ -3071,7 +3079,7 @@ static MigThrError migration_detect_error(MigrationSt= ate *s) * For precopy (or postcopy with error outside IO, or before dest * starts), we fail with no time. */ - migrate_set_state(&s->state, state, MIGRATION_STATUS_FAILED); + migrate_set_state(&s->state, state, MIGRATION_STATUS_FAILING); trace_migration_thread_file_err(); =20 /* Time to stop the migration, now. */ @@ -3302,7 +3310,7 @@ static void migration_iteration_finish(MigrationState= *s) migrate_start_colo_process(s); s->vm_old_state =3D RUN_STATE_RUNNING; /* Fallthrough */ - case MIGRATION_STATUS_FAILED: + case MIGRATION_STATUS_FAILING: case MIGRATION_STATUS_CANCELLED: case MIGRATION_STATUS_CANCELLING: if (!migration_block_activate(&local_err)) { @@ -3368,7 +3376,7 @@ static void bg_migration_iteration_finish(MigrationSt= ate *s) switch (s->state) { case MIGRATION_STATUS_COMPLETED: case MIGRATION_STATUS_ACTIVE: - case MIGRATION_STATUS_FAILED: + case MIGRATION_STATUS_FAILING: case MIGRATION_STATUS_CANCELLED: case MIGRATION_STATUS_CANCELLING: break; @@ -3553,7 +3561,7 @@ static void *migration_thread(void *opaque) if (ret) { migrate_error_propagate(s, local_err); migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, - MIGRATION_STATUS_FAILED); + MIGRATION_STATUS_FAILING); goto out; } =20 @@ -3745,7 +3753,7 @@ fail: /* local_err is guaranteed to be set when reaching here */ migrate_error_propagate(s, local_err); migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, - MIGRATION_STATUS_FAILED); + MIGRATION_STATUS_FAILING); =20 done: bg_migration_iteration_finish(s); diff --git a/migration/multifd.c b/migration/multifd.c index ad6261688f..178c6b3350 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -431,7 +431,7 @@ static void multifd_send_error_propagate(Error *err) s->state =3D=3D MIGRATION_STATUS_DEVICE || s->state =3D=3D MIGRATION_STATUS_ACTIVE) { migrate_set_state(&s->state, s->state, - MIGRATION_STATUS_FAILED); + MIGRATION_STATUS_FAILING); } } } @@ -986,7 +986,7 @@ bool multifd_send_setup(void) =20 err: migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, - MIGRATION_STATUS_FAILED); + MIGRATION_STATUS_FAILING); return false; } =20 diff --git a/qapi/migration.json b/qapi/migration.json index f925e5541b..7134d4ce47 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -158,7 +158,10 @@ # # @completed: migration is finished. # -# @failed: some error occurred during migration process. +# @failing: error occurred during migration, clean-up underway. +# (since 11.0) +# +# @failed: error occurred during migration, clean-up done. # # @colo: VM is in the process of fault tolerance, VM can not get into # this state unless colo capability is enabled for migration. @@ -181,8 +184,8 @@ 'data': [ 'none', 'setup', 'cancelling', 'cancelled', 'active', 'postcopy-device', 'postcopy-active', 'postcopy-paused', 'postcopy-recover-setup', - 'postcopy-recover', 'completed', 'failed', 'colo', - 'pre-switchover', 'device', 'wait-unplug' ] } + 'postcopy-recover', 'completed', 'failing', 'failed', + 'colo', 'pre-switchover', 'device', 'wait-unplug' ] } =20 ## # @VfioStats: diff --git a/tests/qtest/migration/migration-qmp.c b/tests/qtest/migration/= migration-qmp.c index 5c46ceb3e6..8279504db1 100644 --- a/tests/qtest/migration/migration-qmp.c +++ b/tests/qtest/migration/migration-qmp.c @@ -241,7 +241,8 @@ void wait_for_migration_fail(QTestState *from, bool all= ow_active) do { status =3D migrate_query_status(from); bool result =3D !strcmp(status, "setup") || !strcmp(status, "faile= d") || - (allow_active && !strcmp(status, "active")); + (allow_active && !strcmp(status, "active")) || + !strcmp(status, "failing"); if (!result) { fprintf(stderr, "%s: unexpected status status=3D%s allow_activ= e=3D%d\n", __func__, status, allow_active); diff --git a/tests/qtest/migration/precopy-tests.c b/tests/qtest/migration/= precopy-tests.c index a5423ca33c..f17dc5176d 100644 --- a/tests/qtest/migration/precopy-tests.c +++ b/tests/qtest/migration/precopy-tests.c @@ -1247,7 +1247,7 @@ void migration_test_add_precopy(MigrationTestEnv *env) } =20 /* ensure new status don't go unnoticed */ - assert(MIGRATION_STATUS__MAX =3D=3D 16); + assert(MIGRATION_STATUS__MAX =3D=3D 17); =20 for (int i =3D MIGRATION_STATUS_NONE; i < MIGRATION_STATUS__MAX; i++) { switch (i) { @@ -1259,6 +1259,7 @@ void migration_test_add_precopy(MigrationTestEnv *env) case MIGRATION_STATUS_POSTCOPY_PAUSED: case MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP: case MIGRATION_STATUS_POSTCOPY_RECOVER: + case MIGRATION_STATUS_FAILING: continue; default: migration_test_add_suffix("/migration/cancel/src/after/", --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061734; cv=none; d=zohomail.com; s=zohoarc; b=U4GvO0J/w/ZwgzEgwZKyioYFaJTxNzl18LGzYajogHYHDH7gdRcTpF8X2JAFl/JFIZINNE93TinObBU9R2YMl2duR5a1VWYn94Sm9Ch5Hr1zn93DyjYr7R+DtroguyUSGbiPjUg4wu5+qbd2Sgv5jv215WX9jmetIUSk50U+YXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061734; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AbfRi0q4yylQEQZYbKA9eix0ZqfeVuUrcJbKb5Y+FHw=; b=GimND1JJ2x9m8REt5KV2+CpDlzCRwL7uRB0lFPR8DHWXXUYtutmaGx2WLMZULxH57AMSo9HtdGwT16HDCKw8tUsfe5FJqs8aYQJpwKZFf/ZB175gYKHtuWyImmQpLVXKCQ2sWcW7aTMu7lI6dMmuYDxMgi5uhfa8VonZyTGtQpc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061734867951.284987430908; Mon, 9 Mar 2026 06:08:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaKz-0006e5-4d; Mon, 09 Mar 2026 09:07:57 -0400 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 1vzaKx-0006dS-Gu for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:55 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaKv-00087B-Up for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:55 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D18F94D21E; Mon, 9 Mar 2026 13:07:37 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 60E783EEF3; Mon, 9 Mar 2026 13:07:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id eOzDCRjGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061658; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AbfRi0q4yylQEQZYbKA9eix0ZqfeVuUrcJbKb5Y+FHw=; b=IJU6zr5aPnb5zRVoNvIWiEoPBDvRlIq/neeS5LPI6wNCXia439O0iLxBSy62LuoRMeqzj1 QrXop4qYjh2xGV5M25Y8GrFa/Uui0EM4bnw8k4rmnF0Vx1PttqGZEujnYMna9WeyJfW7QS Jxz+DmUvKsVJgOUHZY1E99WDfeA9kKQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061658; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AbfRi0q4yylQEQZYbKA9eix0ZqfeVuUrcJbKb5Y+FHw=; b=Kp3nvYOqWDbn+1jIhE/xlIqXu7S0rPN54WDZHUZUDyM+0NO7j7k8lKlQ4PnxaQaD04RvPY kCEh3Ap2EzH1ghAw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061657; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AbfRi0q4yylQEQZYbKA9eix0ZqfeVuUrcJbKb5Y+FHw=; b=Z8NfOUWrlvm6jx5KJCvdq4N1H9D3ZdSj6hyyQpmM9ClBkNSjkf7/lNwjKcGMEmB4RXrTI0 jACEOBIHht+hqrif8bNZlx7iQxPS8LNoFB/YClHgMlscA5Wjlh45T1DXN8fYSLFRRVXSMF Hf7UMahc6Y29rY64+llDf46Ay7yJWwo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061657; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AbfRi0q4yylQEQZYbKA9eix0ZqfeVuUrcJbKb5Y+FHw=; b=Me5YIc2HE26gZkF4fbFxnnB3Jr12WN6iWW8c1bfIYY1/rpHacNAZba22BO0olbZNkoixlh FYluTLDpkZZJG2Cg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub , Zhang Chen Subject: [PULL 02/22] MAINTAINERS: Add myself as maintainer for COLO migration framework Date: Mon, 9 Mar 2026 10:07:07 -0300 Message-ID: <20260309130730.20526-3-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de,gmail.com]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com,web.de] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1773061737068158500 Content-Type: text/plain; charset="utf-8" From: Lukas Straub I am ready to maintain it. Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-1-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6730cee490..1e5c8a391d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3881,6 +3881,7 @@ F: qapi/yank.json =20 COLO Framework M: Hailiang Zhang +M: Lukas Straub S: Maintained F: migration/colo* F: include/migration/colo.h --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061735; cv=none; d=zohomail.com; s=zohoarc; b=FB+XdCV/fEV+cI6hM+LZysll4RilYyA1YEY/cH0hmRXS44a77gtddg2/D91zwKznrcy4/YUVr+fVYmL3jbhjC+028ZekhyvIKydkDNW6IOibBFtiDK8Ld2H9zkswoInI/jzQwxDHmshGnOc66h9cg75JmlTvd0DnV+UMZJ9YOOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061735; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DlGX5/a/50OVyDCxcnP1TIEFhKfaZD7tbLqomkbaYa8=; b=SSZKIjgIAEy/pigUSzT+WgblkxBQKlN+LGD9u8BgjmhfbMu03hP/y9tzfmcsbkwreKNzH+dPGuxdd2KCQ55gpIvfEYrMPsWd/45m2Sl10E2/sYGxkvExdWAjaLlzXueoypyM50LYuVd3VIju8EEGw6Q9SksmGZMljkAxT67bF4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061735260741.9807190466; Mon, 9 Mar 2026 06:08:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaKq-0006bW-Ak; Mon, 09 Mar 2026 09:07:48 -0400 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 1vzaKm-0006aw-Cy for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:44 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaKk-0007x1-Pk for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:44 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B20F65BE10; Mon, 9 Mar 2026 13:07:39 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4B6373EEF5; Mon, 9 Mar 2026 13:07:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0NaBBBrGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061659; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DlGX5/a/50OVyDCxcnP1TIEFhKfaZD7tbLqomkbaYa8=; b=Eg97T3x2JuKBIl2VZ9BzGIEgqYcTnF63+kKJL6GGFJ2ZWzkrUDDFY7whEy2pKseRCgRmKD 0VqK3zJBmEQmXkHMBicO6ZwzMN0OjFTOUd3NT01FNsRyBRTNV0I0wlVrvEJfQboPz68n9B HyMawM1tBo9KaWGntkLZ8Rj8r9KUG3Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061659; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DlGX5/a/50OVyDCxcnP1TIEFhKfaZD7tbLqomkbaYa8=; b=Lt23/H5y6c+3Wi0nKpjjVVCiZJWXRDp4rZvnLUDVAVLKYGiQXxpXAjOVzbO72rjKHYaJxE nHPFftu7crMnPqBQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061659; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DlGX5/a/50OVyDCxcnP1TIEFhKfaZD7tbLqomkbaYa8=; b=Eg97T3x2JuKBIl2VZ9BzGIEgqYcTnF63+kKJL6GGFJ2ZWzkrUDDFY7whEy2pKseRCgRmKD 0VqK3zJBmEQmXkHMBicO6ZwzMN0OjFTOUd3NT01FNsRyBRTNV0I0wlVrvEJfQboPz68n9B HyMawM1tBo9KaWGntkLZ8Rj8r9KUG3Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061659; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DlGX5/a/50OVyDCxcnP1TIEFhKfaZD7tbLqomkbaYa8=; b=Lt23/H5y6c+3Wi0nKpjjVVCiZJWXRDp4rZvnLUDVAVLKYGiQXxpXAjOVzbO72rjKHYaJxE nHPFftu7crMnPqBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub , Zhang Chen Subject: [PULL 03/22] MAINTAINERS: Remove Hailiang Zhang from COLO migration framework Date: Mon, 9 Mar 2026 10:07:08 -0300 Message-ID: <20260309130730.20526-4-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de,gmail.com]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com,web.de] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061737775154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub His last email to the mailing list is from December 2021: https://lore.kernel.org/qemu-devel/20211214075424.6920-1-zhanghailiang@xfus= ion.com/ Reviewed-by: Peter Xu Reviewed-by: Zhang Chen Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-2-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1e5c8a391d..df78865809 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3880,7 +3880,6 @@ F: include/qemu/yank.h F: qapi/yank.json =20 COLO Framework -M: Hailiang Zhang M: Lukas Straub S: Maintained F: migration/colo* --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061740; cv=none; d=zohomail.com; s=zohoarc; b=ltiXR8QqF972wJqy+zoydyv0Eq6NjN9GtWCMDCAeDbT21W12kULDSDFL2jlPoYYemUAXsdnlE/NkXnKRzhtdtTsRzduOrypqq+0FqpKAqtV4McQf730DyCoGXI6zNNfumCuFxeFK7P3B+CGfcLY6e5HlOIzWwLeec4SxacMY7sk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061740; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QmdV6oRBVx4n4sgdO5Wc0p3HMhyB2UAj5ihDUCSmsao=; b=a5zua7jmMLIY5ikg9oIbotE5am4edHJibiIup81Q7YSLiyTVbToRwWbqYxjVOcdtMavtKsS4CBL0mRQaJero89AcxZP3axRBCo/XZJf3TF7qqM72DwPnOl0nru71S8iDPGId/BX1RTJlUNqonl9mlU0RIwl9bgaACXyWMn7uOzE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061740824962.0710779605741; Mon, 9 Mar 2026 06:09:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaL4-0006fV-Pa; Mon, 09 Mar 2026 09:08:02 -0400 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 1vzaL2-0006fA-Rd for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:00 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaL1-000881-8j for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:00 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 589CC4D21F; Mon, 9 Mar 2026 13:07:41 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2BC133EEF3; Mon, 9 Mar 2026 13:07:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8FhlOBvGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061661; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QmdV6oRBVx4n4sgdO5Wc0p3HMhyB2UAj5ihDUCSmsao=; b=NDKqFjHjGNCzE8PUW6AmuKN7vb675KrovpCRLN3fuAzWeidapIBSd/GeaC+PiXiv2Iv6Y6 p4HvCkg6d0XIMq/G7FNy73/oK2Z8SkjTTVqZIAtGv0pWzluMd2Y+1hxt2lUMRia9ZQ5tJ9 TUiIlslHLa4nro8RvS4k66kNq0jEg80= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061661; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QmdV6oRBVx4n4sgdO5Wc0p3HMhyB2UAj5ihDUCSmsao=; b=61faMPYAEp1CoCq5ZaZqOoGCSiOX7RRR1jTCKV3tM4mrARWyOY8GauX1c5qoOsIkcHlR7U V6nzfIFIASM3NhAg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061661; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QmdV6oRBVx4n4sgdO5Wc0p3HMhyB2UAj5ihDUCSmsao=; b=NDKqFjHjGNCzE8PUW6AmuKN7vb675KrovpCRLN3fuAzWeidapIBSd/GeaC+PiXiv2Iv6Y6 p4HvCkg6d0XIMq/G7FNy73/oK2Z8SkjTTVqZIAtGv0pWzluMd2Y+1hxt2lUMRia9ZQ5tJ9 TUiIlslHLa4nro8RvS4k66kNq0jEg80= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061661; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QmdV6oRBVx4n4sgdO5Wc0p3HMhyB2UAj5ihDUCSmsao=; b=61faMPYAEp1CoCq5ZaZqOoGCSiOX7RRR1jTCKV3tM4mrARWyOY8GauX1c5qoOsIkcHlR7U V6nzfIFIASM3NhAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 04/22] colo: Setup ram cache in normal migration path Date: Mon, 9 Mar 2026 10:07:09 -0300 Message-ID: <20260309130730.20526-5-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061743620154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub 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. Use migrate_colo() to initialize the ram cache in the normal migration path. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-3-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/migration.c | 18 ++++++++++++++---- migration/savevm.c | 14 +------------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index e80774e89b..f881430efc 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -630,10 +630,6 @@ int migration_incoming_enable_colo(Error **errp) return -EINVAL; } =20 - if (ram_block_discard_disable(true)) { - error_setg(errp, "COLO: cannot disable RAM discard"); - return -EBUSY; - } migration_colo_enabled =3D true; return 0; } @@ -770,6 +766,20 @@ process_incoming_migration_co(void *opaque) =20 assert(mis->from_src_file); =20 + if (migrate_colo()) { + if (ram_block_discard_disable(true)) { + error_setg(&local_err, "COLO: cannot disable RAM discard"); + goto fail; + } + + ret =3D colo_init_ram_cache(&local_err); + if (ret) { + error_prepend(&local_err, "failed to init colo RAM cache: %d: = ", + ret); + goto fail; + } + } + mis->largest_page_size =3D qemu_ram_pagesize_largest(); postcopy_state_set(POSTCOPY_INCOMING_NONE); migrate_set_state(&mis->state, MIGRATION_STATUS_SETUP, diff --git a/migration/savevm.c b/migration/savevm.c index 3a16c467b2..b88851cdb7 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2427,19 +2427,7 @@ static int loadvm_process_enable_colo(MigrationIncom= ingState *mis, Error **errp) { ERRP_GUARD(); - int ret; - - ret =3D migration_incoming_enable_colo(errp); - if (ret < 0) { - return ret; - } - - ret =3D colo_init_ram_cache(errp); - if (ret) { - error_prepend(errp, "failed to init colo RAM cache: %d: ", ret); - migration_incoming_disable_colo(); - } - return ret; + return migration_incoming_enable_colo(errp); } =20 static int loadvm_postcopy_handle_switchover_start(Error **errp) --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061772; cv=none; d=zohomail.com; s=zohoarc; b=agBNkWxaa5oh3bhGkWQQDG3+6+0qjnTi9hJ9uURBBYiGqlc7EpkKmXU9JfGNfGRPhsHQR83I0mZRjK28sM89CaZr5FENMBZ/wUC+E8RzMEO5sNvH70tKrD9PTWv7S6BJj0ybpRTLdKbIT8US0onK4i+pvqfKDsvlfUmk6DvfsTk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061772; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qUm/CHRY+wJrgtDLfEU0Rtxwn7We/QfDRlzCcLCaEno=; b=ASmkutvrCOJb8Om9DFP+zCjT+VRww4F69TxlK9FVgL1bCFqg6+NcwtZT4Co2vIJudIh7GiU4OS/ydMWTuxAxpLYIWlqasytzzUKZ0PvGifvTLNrBzi3Rwkfxo1AR1qCsGCMNml5bG4T80rgL0iGj2qxfyJ/1/UrecySW5uF0dCg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061772974401.4458574297623; Mon, 9 Mar 2026 06:09:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLA-0006h2-R4; Mon, 09 Mar 2026 09:08:08 -0400 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 1vzaL8-0006gV-CT for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:06 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaL6-00088y-LB for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:06 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F40264D218; Mon, 9 Mar 2026 13:07:42 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C69C03EEF3; Mon, 9 Mar 2026 13:07:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id cLKmIh3GrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qUm/CHRY+wJrgtDLfEU0Rtxwn7We/QfDRlzCcLCaEno=; b=QwWrr9W2jiohsGug16jbVHG245V0mgOzqIvMdosLNAkdj/OYoS+35OLLdNXV6n/vN6dyEw xXxKc19kMfB7wBANHyYhuEv4PPxzVtKg6nmTXV4ytm1Yis6QppPMjWHcWuG8wWtFezEN/T /57NqvenTeTkUdDSOP9XHDXfu/BuyWY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qUm/CHRY+wJrgtDLfEU0Rtxwn7We/QfDRlzCcLCaEno=; b=JbS6cUtQ67Q5vIhMs6Eh9LGu3+DxNLtQrMx+yJSJ2QwwvrXpesVanXG3cUXPYs+7t0wspl vM+jQ08IYmEXXyBg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qUm/CHRY+wJrgtDLfEU0Rtxwn7We/QfDRlzCcLCaEno=; b=QwWrr9W2jiohsGug16jbVHG245V0mgOzqIvMdosLNAkdj/OYoS+35OLLdNXV6n/vN6dyEw xXxKc19kMfB7wBANHyYhuEv4PPxzVtKg6nmTXV4ytm1Yis6QppPMjWHcWuG8wWtFezEN/T /57NqvenTeTkUdDSOP9XHDXfu/BuyWY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061663; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qUm/CHRY+wJrgtDLfEU0Rtxwn7We/QfDRlzCcLCaEno=; b=JbS6cUtQ67Q5vIhMs6Eh9LGu3+DxNLtQrMx+yJSJ2QwwvrXpesVanXG3cUXPYs+7t0wspl vM+jQ08IYmEXXyBg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 05/22] colo: Replace migration_incoming_colo_enabled() with migrate_colo() Date: Mon, 9 Mar 2026 10:07:10 -0300 Message-ID: <20260309130730.20526-6-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061773187158500 Content-Type: text/plain; charset="utf-8" From: Lukas Straub 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 Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-4-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- 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 d4fe422e4d..2496a968cc 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); =20 COLOMode get_colo_mode(void); diff --git a/migration/colo.c b/migration/colo.c index f7a5bd3619..97a224c39c 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -935,7 +935,7 @@ void coroutine_fn colo_incoming_co(void) QemuThread th; =20 assert(bql_locked()); - assert(migration_incoming_colo_enabled()); + assert(migrate_colo()); =20 qemu_thread_create(&th, MIGRATION_THREAD_DST_COLO, colo_process_incoming_thread, diff --git a/migration/migration.c b/migration/migration.c index f881430efc..e56756dd04 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -605,11 +605,6 @@ int migrate_send_rp_req_pages(MigrationIncomingState *= mis, } =20 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; } =20 - 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 fc7ece2c1a..aebf77aa0b 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 downtim= e 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 =3D colo_cache_from_block_offset(block, addr, tru= e); --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061735; cv=none; d=zohomail.com; s=zohoarc; b=eh3rfKLPglegkdy+z72tSBughESrzOa8bD2Wjsk13O8HA19y08eK9wKoOQRI+ChnavdDCeyxr/ioTaT+UYSManasH04G66AdXw5xDl1jaayntSo9/3pCSfh2nYjTGnxAqcF2hX+hfv9KHm7hTVRbzL8gK9kkHrGl02LeorJQ/fE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061735; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZxI6r3XeRbV3QkIwamso+SsR8CZcDQPoZPkc4mv5pQs=; b=JeOPFKp0kc4iSIuRnvKphSOnUEW8IG4Ci1daY7h1YQKIgLQDwaDueQUbv5aysEKm7zbgwNAubB+nHhiiMFN+RfdoQRyEp+ZMcNz+5oZPO6e72tcQoYbTj0CU51/4XHnwRiwyI+TFAMCeSNBCB0DNitOnWRlFTUz07US7vyaZKyA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061735218283.68280630738514; Mon, 9 Mar 2026 06:08:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLF-0006iM-Qg; Mon, 09 Mar 2026 09:08:13 -0400 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 1vzaLE-0006ht-Bo for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:12 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLC-0008A1-FZ for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:12 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9C2774D21B; Mon, 9 Mar 2026 13:07:44 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6E0B53EEF2; Mon, 9 Mar 2026 13:07:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id IIz7DB/GrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061664; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZxI6r3XeRbV3QkIwamso+SsR8CZcDQPoZPkc4mv5pQs=; b=Ki+qNbk2y2NMucsIZMq/Z02S99vTFfqIFjhL2ULjscEABtS5gOPzLaWocm8HiqqPxIjw8k aTbX0M4DXZC44PK9JqiGLvwrDXfojigil1fcs0PkQToRJjZW761MzXQUwaJYUGZyws3k9H HVDdrLhoA+b5UOFR07PrSCDrNhI/0is= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061664; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZxI6r3XeRbV3QkIwamso+SsR8CZcDQPoZPkc4mv5pQs=; b=rTCNciJo7Kvx60dbnqBMnmIXxD651Y3XIRJunahLPZEsj7GjG1Mlvgmx8Fuj2e3zvOqRsd AdfqEPB2Gme/8BBQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061664; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZxI6r3XeRbV3QkIwamso+SsR8CZcDQPoZPkc4mv5pQs=; b=Ki+qNbk2y2NMucsIZMq/Z02S99vTFfqIFjhL2ULjscEABtS5gOPzLaWocm8HiqqPxIjw8k aTbX0M4DXZC44PK9JqiGLvwrDXfojigil1fcs0PkQToRJjZW761MzXQUwaJYUGZyws3k9H HVDdrLhoA+b5UOFR07PrSCDrNhI/0is= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061664; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZxI6r3XeRbV3QkIwamso+SsR8CZcDQPoZPkc4mv5pQs=; b=rTCNciJo7Kvx60dbnqBMnmIXxD651Y3XIRJunahLPZEsj7GjG1Mlvgmx8Fuj2e3zvOqRsd AdfqEPB2Gme/8BBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 06/22] colo: Remove ENABLE_COLO savevm command and mark it as deprecated Date: Mon, 9 Mar 2026 10:07:11 -0300 Message-ID: <20260309130730.20526-7-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061737767154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub 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 Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-5-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- 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 2496a968cc..8f94054a10 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); =20 /* loadvm */ -int migration_incoming_enable_colo(Error **errp); -void migration_incoming_disable_colo(void); bool migration_incoming_in_colo_state(void); =20 COLOMode get_colo_mode(void); diff --git a/migration/migration.c b/migration/migration.c index e56756dd04..f10abf91e2 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); } =20 -static bool migration_colo_enabled; -void migration_incoming_disable_colo(void) -{ - ram_block_discard_disable(false); - migration_colo_enabled =3D false; -} - -int migration_incoming_enable_colo(Error **errp) -{ -#ifndef CONFIG_REPLICATION - error_setg(errp, "ENABLE_COLO command come in migration stream, but th= e " - "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 =3D true; - return 0; -} - void migrate_add_address(SocketAddress *address) { MigrationIncomingState *mis =3D 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()); @@ -3542,11 +3516,6 @@ static void *migration_thread(void *opaque) qemu_savevm_send_postcopy_advise(s->to_dst_file); } =20 - 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 b88851cdb7..197c89e0e6 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_CO= LO */ 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); } =20 -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(MigrationIncomi= ngState *mis, return 0; } =20 -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; =20 case MIG_CMD_PING: tmp32 =3D 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; =20 case MIG_CMD_PACKAGED: return loadvm_handle_cmd_packaged(mis, errp); @@ -2548,14 +2535,12 @@ static int loadvm_process_command(QEMUFile *f, Erro= r **errp) case MIG_CMD_RECV_BITMAP: return loadvm_handle_recv_bitmap(mis, len, errp); =20 - case MIG_CMD_ENABLE_COLO: - return loadvm_process_enable_colo(mis, errp); - case MIG_CMD_SWITCHOVER_START: return loadvm_postcopy_handle_switchover_start(errp); } =20 - return 0; + error_setg(errp, "MIG_CMD 0x%x deprecated (len 0x%x)", cmd, len); + return -EINVAL; } =20 /* diff --git a/migration/savevm.h b/migration/savevm.h index 2ba0881f3b..b3d1e8a13c 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -65,7 +65,6 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, c= onst 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 90629f828f..60e5087e38 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) "" --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061786; cv=none; d=zohomail.com; s=zohoarc; b=E+hlHPtDYJH0fKNXOPCkDIIscdYncA+XH4e+NV3SSzHGci1nqTEplcsDIEwZy4xcSq03ERknuO074ujQpkkQFQ5VcblP2CqLHc48SVDx6OXZXd4VCpQ4woe1wIJYzH7hbtI994/pxS9fUmOrukvu2UvQLoIXeeQfvkKE10BbRig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061786; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WoRksr1tkJHvCuSfsrKfWrTk0/Z0zlvuIQGLg3X2HV0=; b=oET020tzP3sN1oY4QJMGxahNnhbTTXcbLVhh95geY0rUrs09M8+fLzLqBdRux9mplmCarh3wTBZR4FbPMu1Sfha9bnzwtoGUZhgHjcvnruOnzqWzdb+70U1UhFqxkak3ZBGsq57o1rJamdWb7QNuJ4W21apk7eEYOH31+Uir8z4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061786634286.423195408904; Mon, 9 Mar 2026 06:09:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaKw-0006d3-G5; Mon, 09 Mar 2026 09:07:54 -0400 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 1vzaKt-0006cO-Eu for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:51 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaKq-00082t-Td for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:51 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 43F335BD8F; Mon, 9 Mar 2026 13:07:46 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 15FD03EEF2; Mon, 9 Mar 2026 13:07:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id gLEdMyDGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WoRksr1tkJHvCuSfsrKfWrTk0/Z0zlvuIQGLg3X2HV0=; b=q09ekRPVwjtrTe8PFQmkncyCLdPWovxlyBdwT0nDZvomxxFXtpmnNh6LE15t6pp6nmmRqd dhC6yhw2fXfoFOH14F6SDfn2yRI+sAiiOtC8C5+1tG9R75FFrlArM+dZUtAS+B1zGQL/4z /s9WUAUk28kobLEtiqkQ0JNW9fc8qYM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WoRksr1tkJHvCuSfsrKfWrTk0/Z0zlvuIQGLg3X2HV0=; b=MeLjq81ftYTGWBbffT0Um3Z+rgROgVC/dR0pulciHXvtUS+AMs9c462gI3BN0PtuWzx5sn nDmjvWH2WUqlaHBw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WoRksr1tkJHvCuSfsrKfWrTk0/Z0zlvuIQGLg3X2HV0=; b=q09ekRPVwjtrTe8PFQmkncyCLdPWovxlyBdwT0nDZvomxxFXtpmnNh6LE15t6pp6nmmRqd dhC6yhw2fXfoFOH14F6SDfn2yRI+sAiiOtC8C5+1tG9R75FFrlArM+dZUtAS+B1zGQL/4z /s9WUAUk28kobLEtiqkQ0JNW9fc8qYM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WoRksr1tkJHvCuSfsrKfWrTk0/Z0zlvuIQGLg3X2HV0=; b=MeLjq81ftYTGWBbffT0Um3Z+rgROgVC/dR0pulciHXvtUS+AMs9c462gI3BN0PtuWzx5sn nDmjvWH2WUqlaHBw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 07/22] ram: Remove colo special-casing Date: Mon, 9 Mar 2026 10:07:12 -0300 Message-ID: <20260309130730.20526-8-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061788326154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub We only enter colo state after the precopy migration is finished so this if is always taken. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-6-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/ram.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index aebf77aa0b..979751f61b 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -3116,12 +3116,12 @@ static int ram_save_setup(QEMUFile *f, void *opaque= , Error **errp) RAMBlock *block; int ret, max_hg_page_size; =20 - /* migration has already setup the bitmap, reuse it. */ - if (!migration_in_colo_state()) { - if (ram_init_all(rsp, errp) !=3D 0) { - return -1; - } + assert(!migration_in_colo_state()); + + if (ram_init_all(rsp, errp) !=3D 0) { + return -1; } + (*rsp)->pss[RAM_CHANNEL_PRECOPY].pss_channel =3D f; =20 /* --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061740; cv=none; d=zohomail.com; s=zohoarc; b=fUYnJHSPTKQIVl5o1Xn23hjSrzaG5NMWsmQRsfE24ALswWOQZYVPpwpUIjfqYQOQEfMtJFr8illzIVs0GwtZ9zFMyOEchXHKCeFIKjdo+f0ewX7Za72YmqYy95OPk1akOifMg4f373+Xkf9vAHglVtdh0DzrVCri8WaKhGFwYdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061740; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iy8KN+46QRzcDgjMvL5YwDy3AmTxB6WCiZtfuFM46VI=; b=QbO1EYtO7vMcdPC+WJdVD0CvUa7W/ADHpuKnJQIald8cTMKsqNZFObtLwolN6SYMO24zyOllRA1NY6sMS6JGBapE0ThuR5/HsfIdp46PXtequSvD6mr+uceQRVwzyk4ofbl98FgZurmf11JuByK/RAzHI4nP9GfpVNbf8bo/f30= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061740905669.4250916198081; Mon, 9 Mar 2026 06:09:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaL0-0006ek-Rp; Mon, 09 Mar 2026 09:07:58 -0400 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 1vzaKz-0006e6-A9 for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:57 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaKx-00087Z-Mx for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:07:57 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DF5865BDC1; Mon, 9 Mar 2026 13:07:47 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B104E3EEF2; Mon, 9 Mar 2026 13:07:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id mJlRHSLGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061667; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iy8KN+46QRzcDgjMvL5YwDy3AmTxB6WCiZtfuFM46VI=; b=0N2+0aGqt74OYtFwe0WioHoAW1hK9zYW7YDjMy8SaRIgm9C8ueysIgrTrPFpfrJhvxw9KO IhqDF24opYbEHcHC9s4TLHH6WAUj87g94+/QTKcQ1le2BOhrvZtr7iMGzfle5wnr9FFWJs yKzklVAyicE+tqgwUYGQXPUdlo4jNlY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061667; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iy8KN+46QRzcDgjMvL5YwDy3AmTxB6WCiZtfuFM46VI=; b=9JZI58J7syBLe2N5CGtwVGae9lI1YdSV7+qEMCX8FvUlN/0FwqQLg4J+QKeqo3c1XoENrh HOca5xiw0zWz+wCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061667; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iy8KN+46QRzcDgjMvL5YwDy3AmTxB6WCiZtfuFM46VI=; b=0N2+0aGqt74OYtFwe0WioHoAW1hK9zYW7YDjMy8SaRIgm9C8ueysIgrTrPFpfrJhvxw9KO IhqDF24opYbEHcHC9s4TLHH6WAUj87g94+/QTKcQ1le2BOhrvZtr7iMGzfle5wnr9FFWJs yKzklVAyicE+tqgwUYGQXPUdlo4jNlY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061667; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iy8KN+46QRzcDgjMvL5YwDy3AmTxB6WCiZtfuFM46VI=; b=9JZI58J7syBLe2N5CGtwVGae9lI1YdSV7+qEMCX8FvUlN/0FwqQLg4J+QKeqo3c1XoENrh HOca5xiw0zWz+wCA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 08/22] multifd: Move ram state receive into multifd_ram_state_recv() Date: Mon, 9 Mar 2026 10:07:13 -0300 Message-ID: <20260309130730.20526-9-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061743600154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub This is in preparation for the next patch. Reviewed-by: Peter Xu Reviewed-by: Fabiano Rosas Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-7-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/multifd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/migration/multifd.c b/migration/multifd.c index 178c6b3350..4259ab2628 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -1253,6 +1253,15 @@ static int multifd_device_state_recv(MultiFDRecvPara= ms *p, Error **errp) return ret; } =20 +static int multifd_ram_state_recv(MultiFDRecvParams *p, Error **errp) +{ + int ret; + + ret =3D multifd_recv_state->ops->recv(p, errp); + + return ret; +} + static void *multifd_recv_thread(void *opaque) { MigrationState *s =3D migrate_get_current(); @@ -1387,7 +1396,7 @@ static void *multifd_recv_thread(void *opaque) assert(use_packets); ret =3D multifd_device_state_recv(p, &local_err); } else { - ret =3D multifd_recv_state->ops->recv(p, &local_err); + ret =3D multifd_ram_state_recv(p, &local_err); } if (ret !=3D 0) { break; --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061738; cv=none; d=zohomail.com; s=zohoarc; b=B1nReGBZbHiXzHNHEhbZv4GGq3NAtb1nOxoH9N8VWyHjgPPUOZ1mH8bIv6UzgyutcpeHG2tdBs5ifhtsa7jiyV+Of3FONdbP1iYpf0uuFItxplMSiianB+SeTLytf7/Yp4EmAk9TPJdvR+kjuwlkZ1XvyILtU/ZbzbKZlE/jck0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061738; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EI/hm+oCGbJNJPXLYwaaghjCssMy0e6uep2ugqXpmMk=; b=Goauzdq5Bui4vtN3s1p8KrpJBl6bn1HewuSToc5uA7QTIEM50/GuLJjzyzyy+YDQ1Zr8QNF6/zGLCPOHsNb0rdr5Wc2su9EogbVIkKJkmQzZnrmpiBXS7N2fWWI8N+NNPLkTCu3ALXDHnJna/uuY74xrzSTG+y+ZW13xRxSox/w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061738687740.079874566809; Mon, 9 Mar 2026 06:08:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaL8-0006gW-M4; Mon, 09 Mar 2026 09:08:06 -0400 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 1vzaL5-0006g0-CA for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:04 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaL3-00088E-8l for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:03 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BF7295BDDF; Mon, 9 Mar 2026 13:07:49 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5952F3EEF2; Mon, 9 Mar 2026 13:07:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kC7uByTGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061669; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EI/hm+oCGbJNJPXLYwaaghjCssMy0e6uep2ugqXpmMk=; b=nWSbdZfQQhG9BXC+CsfRVo2RqD9jUgPxwUzyPswkJQ4x9OX8XmUmoa5sWStJms9PGFHCtk Flqmqz7yxHQ/YcEBiuuWvo1l98qk2GKEKg6MNpcy71QphG60RC54z+5Is41Cef297t8kBz O8orKrMpdiVoD6g+nFJH4RRXjLmjjuk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061669; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EI/hm+oCGbJNJPXLYwaaghjCssMy0e6uep2ugqXpmMk=; b=SHkkb3o30JcFY2bJO7Fz23BLQmyI0ie/bNMH1eUURbmiT0aOLjo4qbVBG6CX6yebB5xx8V Pu6O5UDXYNijPCCw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061669; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EI/hm+oCGbJNJPXLYwaaghjCssMy0e6uep2ugqXpmMk=; b=nWSbdZfQQhG9BXC+CsfRVo2RqD9jUgPxwUzyPswkJQ4x9OX8XmUmoa5sWStJms9PGFHCtk Flqmqz7yxHQ/YcEBiuuWvo1l98qk2GKEKg6MNpcy71QphG60RC54z+5Is41Cef297t8kBz O8orKrMpdiVoD6g+nFJH4RRXjLmjjuk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061669; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EI/hm+oCGbJNJPXLYwaaghjCssMy0e6uep2ugqXpmMk=; b=SHkkb3o30JcFY2bJO7Fz23BLQmyI0ie/bNMH1eUURbmiT0aOLjo4qbVBG6CX6yebB5xx8V Pu6O5UDXYNijPCCw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub , Juan Quintela Subject: [PULL 09/22] multifd: Add COLO support Date: Mon, 9 Mar 2026 10:07:14 -0300 Message-ID: <20260309130730.20526-10-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061739691154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub Like in the normal ram_load() path, put the received pages into the colo cache and mark the pages in the bitmap so that they will be flushed to the guest later. Multifd with COLO is useful to reduce the VM pause time during checkpointing for latency sensitive workloads. In such workloads the worst-case latency is especially important. Also, this is already worth it for the precopy phase as it helps with converging. Moreover, multifd migration is the preferred way to do migration nowadays and this allows to use multifd compression with COLO. Benchmark: Cluster nodes - Intel Xenon E5-2630 v3 - 48Gb RAM - 10G Ethernet Guest - Windows Server 2016 - 6Gb RAM - 4 cores Workload - Upload a file to the guest with SMB to simulate moderate memory dirtying - Measure the memory transfer time portion of each checkpoint - 600ms COLO checkpoint interval Results Plain idle mean: 4.50ms 99per: 10.33ms load mean: 24.30ms 99per: 78.05ms Multifd-4 idle mean: 6.48ms 99per: 10.41ms load mean: 14.12ms 99per: 31.27ms Evaluation While multifd has slightly higher latency when the guest idles, it is 10ms faster under load and more importantly it's worst case latency is less than 1/2 of plain under load as can be seen in the 99. Percentile. Co-authored-by: Juan Quintela [farosas: changed SoB to coauthored as Juan doesn't own that email address = anymore] Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-8-d653fb3b1d80@web.de [removed license boilerplate] Signed-off-by: Fabiano Rosas --- MAINTAINERS | 1 + migration/meson.build | 2 +- migration/multifd-colo.c | 41 ++++++++++++++++++++++++++++++++++++++ migration/multifd-colo.h | 23 +++++++++++++++++++++ migration/multifd-nocomp.c | 10 +++++++++- migration/multifd.c | 8 ++++++++ migration/multifd.h | 5 ++++- 7 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 migration/multifd-colo.c create mode 100644 migration/multifd-colo.h diff --git a/MAINTAINERS b/MAINTAINERS index df78865809..d8dc4c8d7b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3883,6 +3883,7 @@ COLO Framework M: Lukas Straub S: Maintained F: migration/colo* +F: migration/multifd-colo.* F: include/migration/colo.h F: include/migration/failover.h F: docs/COLO-FT.txt diff --git a/migration/meson.build b/migration/meson.build index c7f39bdb55..c9f0f5f9f2 100644 --- a/migration/meson.build +++ b/migration/meson.build @@ -39,7 +39,7 @@ system_ss.add(files( ), gnutls, zlib) =20 if get_option('replication').allowed() - system_ss.add(files('colo-failover.c', 'colo.c')) + system_ss.add(files('colo-failover.c', 'colo.c', 'multifd-colo.c')) else system_ss.add(files('colo-stubs.c')) endif diff --git a/migration/multifd-colo.c b/migration/multifd-colo.c new file mode 100644 index 0000000000..fb13e38b9b --- /dev/null +++ b/migration/multifd-colo.c @@ -0,0 +1,41 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * multifd colo implementation + * + * Copyright (c) Lukas Straub + */ + +#include "qemu/osdep.h" +#include "multifd.h" +#include "multifd-colo.h" +#include "migration/colo.h" +#include "system/ramblock.h" + +void multifd_colo_prepare_recv(MultiFDRecvParams *p) +{ + /* + * While we're still in precopy state (not yet in colo state), we copy + * received pages to both guest and cache. No need to set dirty bits, + * since guest and cache memory are in sync. + */ + if (migration_incoming_in_colo_state()) { + colo_record_bitmap(p->block, p->normal, p->normal_num); + colo_record_bitmap(p->block, p->zero, p->zero_num); + } +} + +void multifd_colo_process_recv(MultiFDRecvParams *p) +{ + if (!migration_incoming_in_colo_state()) { + for (int i =3D 0; i < p->normal_num; i++) { + void *guest =3D p->block->host + p->normal[i]; + void *cache =3D p->host + p->normal[i]; + memcpy(guest, cache, multifd_ram_page_size()); + } + for (int i =3D 0; i < p->zero_num; i++) { + void *guest =3D p->block->host + p->zero[i]; + memset(guest, 0, multifd_ram_page_size()); + } + } +} diff --git a/migration/multifd-colo.h b/migration/multifd-colo.h new file mode 100644 index 0000000000..1011c5a1da --- /dev/null +++ b/migration/multifd-colo.h @@ -0,0 +1,23 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * multifd colo header + * + * Copyright (c) Lukas Straub + */ + +#ifndef QEMU_MIGRATION_MULTIFD_COLO_H +#define QEMU_MIGRATION_MULTIFD_COLO_H + +#ifdef CONFIG_REPLICATION + +void multifd_colo_prepare_recv(MultiFDRecvParams *p); +void multifd_colo_process_recv(MultiFDRecvParams *p); + +#else + +static inline void multifd_colo_prepare_recv(MultiFDRecvParams *p) {} +static inline void multifd_colo_process_recv(MultiFDRecvParams *p) {} + +#endif +#endif diff --git a/migration/multifd-nocomp.c b/migration/multifd-nocomp.c index 9be79b3b8e..9f7a792fa7 100644 --- a/migration/multifd-nocomp.c +++ b/migration/multifd-nocomp.c @@ -16,6 +16,7 @@ #include "file.h" #include "migration-stats.h" #include "multifd.h" +#include "multifd-colo.h" #include "options.h" #include "migration.h" #include "qapi/error.h" @@ -269,7 +270,6 @@ int multifd_ram_unfill_packet(MultiFDRecvParams *p, Err= or **errp) return -1; } =20 - p->host =3D p->block->host; for (i =3D 0; i < p->normal_num; i++) { uint64_t offset =3D be64_to_cpu(packet->offset[i]); =20 @@ -294,6 +294,14 @@ int multifd_ram_unfill_packet(MultiFDRecvParams *p, Er= ror **errp) p->zero[i] =3D offset; } =20 + if (migrate_colo()) { + multifd_colo_prepare_recv(p); + assert(p->block->colo_cache); + p->host =3D p->block->colo_cache; + } else { + p->host =3D p->block->host; + } + return 0; } =20 diff --git a/migration/multifd.c b/migration/multifd.c index 4259ab2628..2193088996 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -29,6 +29,7 @@ #include "qemu-file.h" #include "trace.h" #include "multifd.h" +#include "multifd-colo.h" #include "options.h" #include "qemu/yank.h" #include "io/channel-file.h" @@ -1258,6 +1259,13 @@ static int multifd_ram_state_recv(MultiFDRecvParams = *p, Error **errp) int ret; =20 ret =3D multifd_recv_state->ops->recv(p, errp); + if (ret !=3D 0) { + return ret; + } + + if (migrate_colo()) { + multifd_colo_process_recv(p); + } =20 return ret; } diff --git a/migration/multifd.h b/migration/multifd.h index 89a395aef2..fbc35702b0 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -279,7 +279,10 @@ typedef struct { uint64_t packets_recved; /* ramblock */ RAMBlock *block; - /* ramblock host address */ + /* + * Normally, it points to ramblock's host address. When COLO + * is enabled, it points to the mirror cache for the ramblock. + */ uint8_t *host; /* buffers to recv */ struct iovec *iov; --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061889; cv=none; d=zohomail.com; s=zohoarc; b=JV7eWP5hNbEFxhCdx7/vz42wCKlQvt12ApzCvebyJznxBWPpyrJ84NC7697Duiwq9obY7y8024oWTkBMt6KhO8ECrxJSawUNIWtm2TBzpS7mRTREdDDp/s5thv5ah7VzcxPbbU+Ck2n9jcBEhN7bO5SZ29Q2pSQDC5dIRoj2jWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061889; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eAlk+qZJQ+itxdthlB4L4Nvinczj1d6sime3WKa0b5g=; b=iEVTWu+dhP74f+O8YDTWQVwCvCcGgi5aw5Dc1XyiS8d0RYBNYGCXjMwrM+8iz32IQGy+2xXqGKWPdeeAKgAr/N2q9ViVqojx5HQjJjiQ55uvIhlVkx2loHAS7XaoM8/juImt1LPrR4mYl0pG0xns7vSZyAcrLhWxyB6ky8Z8nzw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061889937531.5395628943098; Mon, 9 Mar 2026 06:11:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLD-0006hc-CP; Mon, 09 Mar 2026 09:08:11 -0400 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 1vzaLB-0006hI-Al for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:09 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaL9-00089j-Kd for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:09 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 67F215BD8F; Mon, 9 Mar 2026 13:07:51 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 397833EEF2; Mon, 9 Mar 2026 13:07:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id CIcMACbGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061671; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eAlk+qZJQ+itxdthlB4L4Nvinczj1d6sime3WKa0b5g=; b=u3AqorOySQE/shMU1FNRHMPoEjhbvLirvrBE5J3JbI6pX9afjdmDkMUqiPFgmSn+VT9Zd/ /TIL3MoIzcyiwCEsTT3pZVpBFIL9w14kjpXB7pqMeFoiL555YRu2knQ6m20v8BFrgO/YXx rDHRjPPM+ZF3TXpUDUVXCYuUwHwf0qM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061671; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eAlk+qZJQ+itxdthlB4L4Nvinczj1d6sime3WKa0b5g=; b=e2Ap9253cbcXiRhcp2E9csHO3wIklGr79cTMnWzlcocXJ9e/1Vxq0Uh15iVHzYuSRaTkBK A8o3c81z+7Nmk7Dw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=u3AqorOy; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=e2Ap9253 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061671; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eAlk+qZJQ+itxdthlB4L4Nvinczj1d6sime3WKa0b5g=; b=u3AqorOySQE/shMU1FNRHMPoEjhbvLirvrBE5J3JbI6pX9afjdmDkMUqiPFgmSn+VT9Zd/ /TIL3MoIzcyiwCEsTT3pZVpBFIL9w14kjpXB7pqMeFoiL555YRu2knQ6m20v8BFrgO/YXx rDHRjPPM+ZF3TXpUDUVXCYuUwHwf0qM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061671; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eAlk+qZJQ+itxdthlB4L4Nvinczj1d6sime3WKa0b5g=; b=e2Ap9253cbcXiRhcp2E9csHO3wIklGr79cTMnWzlcocXJ9e/1Vxq0Uh15iVHzYuSRaTkBK A8o3c81z+7Nmk7Dw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 10/22] Call colo_release_ram_cache() after multifd threads terminate Date: Mon, 9 Mar 2026 10:07:15 -0300 Message-ID: <20260309130730.20526-11-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Action: no action X-Spam-Score: -3.01 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 67F215BD8F Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061891954158500 Content-Type: text/plain; charset="utf-8" From: Lukas Straub The multifd threads still may access the colo cache, so release it only after they terminate. Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-9-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/colo.c | 3 --- migration/migration.c | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 97a224c39c..96102c9d0f 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -949,7 +949,4 @@ void coroutine_fn colo_incoming_co(void) /* Wait checkpoint incoming thread exit before free resource */ qemu_thread_join(&th); bql_lock(); - - /* We hold the global BQL, so it is safe here */ - colo_release_ram_cache(); } diff --git a/migration/migration.c b/migration/migration.c index f10abf91e2..53bf87c3fc 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -454,6 +454,9 @@ void migration_incoming_state_destroy(void) * BQL and retake unconditionally. */ assert(bql_locked()); + if (migrate_colo()) { + colo_release_ram_cache(); + } qemu_loadvm_state_cleanup(mis); =20 if (mis->to_src_file) { --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061800; cv=none; d=zohomail.com; s=zohoarc; b=ABMb//6q6YO164+XrrF5s//cIgxM3uovXxu9AhKLenYnP4/9RovNaEQZaiTuwdMCLxXRLj8MbO/0s9LSD0+hwvW3M7ceBmdpfr0iuUoSZ9lXAcTXDEf6TYM3tSPrBObSCBxR9yoeU1gD4+bsCetv2JqdZ5+3EOdMHBrHgLydY5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061800; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cA2Xm82tWaXcX6p6TYQd8qQYAPkx9Kmf0sjJ54P2o30=; b=gsN5pe7BRN2iHGDjIHW42Guk6TrGknFp338OzcN95xYo9gZaxNe+B/VgQyNCTBmZEe+eeZZpD+fYrq2dDlEKkEbymMQM372NMKljZpLph9xJaSrsHg2z+ZPq6DIuvCtpDjL7WnZrshZky90XYF3SDR0WH7ktTnjKGAPwZGXm2dc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061800722800.6633441620786; Mon, 9 Mar 2026 06:10:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLM-0006rC-Bq; Mon, 09 Mar 2026 09:08:20 -0400 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 1vzaLG-0006iR-Ne for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:14 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLF-0008AU-52 for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:14 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0EFEB5BD87; Mon, 9 Mar 2026 13:07:53 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D57573EEF2; Mon, 9 Mar 2026 13:07:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id AEY0JifGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061673; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cA2Xm82tWaXcX6p6TYQd8qQYAPkx9Kmf0sjJ54P2o30=; b=Hp5HycBJemkDtjYrsn5R0I2e4SFnvL9cMTxAibKERs0uGPCVBThTX5h1RDNRm7MiokBgWw Uqa4qNJPCGTxJ+eaLMg12JWlVSdErmphTZgxxg3RGPFyqxUkkiVI6feaAnEu3ShBOhI25I I5fIn7J7HFLYC6Bg9zmyn4QFsbChzkg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061673; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cA2Xm82tWaXcX6p6TYQd8qQYAPkx9Kmf0sjJ54P2o30=; b=etTv0/GMnntebW4r7a14NoPSmUwPfyQ6pG8go+Oi+NzrnN70M36/tFmHdBtn1X0BUvucKO UeNeGjQ4UI+iJFDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Hp5HycBJ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="etTv0/GM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061673; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cA2Xm82tWaXcX6p6TYQd8qQYAPkx9Kmf0sjJ54P2o30=; b=Hp5HycBJemkDtjYrsn5R0I2e4SFnvL9cMTxAibKERs0uGPCVBThTX5h1RDNRm7MiokBgWw Uqa4qNJPCGTxJ+eaLMg12JWlVSdErmphTZgxxg3RGPFyqxUkkiVI6feaAnEu3ShBOhI25I I5fIn7J7HFLYC6Bg9zmyn4QFsbChzkg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061673; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cA2Xm82tWaXcX6p6TYQd8qQYAPkx9Kmf0sjJ54P2o30=; b=etTv0/GMnntebW4r7a14NoPSmUwPfyQ6pG8go+Oi+NzrnN70M36/tFmHdBtn1X0BUvucKO UeNeGjQ4UI+iJFDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 11/22] colo: Fix crash during device vmstate load Date: Mon, 9 Mar 2026 10:07:16 -0300 Message-ID: <20260309130730.20526-12-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 0EFEB5BD87 X-Spam-Score: -3.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061802549154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub With colo we load device vmstate during each checkpoint, on top of a vm that was already running. Some devices expect a reset before loading vmstate on such a previously running vm. This fixes a crash when using COLO with Q35 machine. The reset adds 10-20ms overhead to the checkpointing proces in my testing. Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-10-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/colo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index 96102c9d0f..dc7cfa81ef 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -729,6 +729,12 @@ static void colo_incoming_process_checkpoint(Migration= IncomingState *mis, =20 bql_lock(); vmstate_loading =3D true; + /* + * With colo we load device vmstate during each checkpoint, on top of + * a vm that was already running. Some devices expect a reset before + * loading vmstate on such a previously running vm. + */ + qemu_system_reset(SHUTDOWN_CAUSE_SNAPSHOT_LOAD); colo_flush_ram_cache(); ret =3D qemu_load_device_state(fb, errp); if (ret < 0) { --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061761; cv=none; d=zohomail.com; s=zohoarc; b=MQJJGk+4PUV+Hhv7fmPk7VJ43Xcw0PZ82yyT6mMhfKh5+ZumvWb4m9BjefZabQEzRF4hJkXm7jHt9sR+i0l+Yq+gqQlpRkG0l+lfXRA7tB/JUqYyclC+RVpUN2J9U9hsfI0m0i+1kMDYh8uwqdHrzFPSQeWJqRFg8UKeXuzyv5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061761; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mS6DYuTFdH4glH6/mGthCFqaTDBftkuwLBiAxzJBLiQ=; b=Rr/yiObH2GNWVSNbNbFaS9fIsv6e6Qozhu1dQkl8HPN+YBD9fPVBKJbTylCEo5R0J9tSFh/HsWA4Pe14/hGwdxevAxAU+tomt9ZjIb0RuSoMK4bnXWH61XdoKSethS7NYA4I00q0tGFXGO5uv6GP4D+fU8G56yjaRKsRCYZemVo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061761341611.2642097266026; Mon, 9 Mar 2026 06:09:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLf-0007Fm-6N; Mon, 09 Mar 2026 09:08:40 -0400 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 1vzaLM-0006w7-KC for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:22 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLK-0008B3-CW for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:20 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AB2F75BDE4; Mon, 9 Mar 2026 13:07:54 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7D12A3EEF2; Mon, 9 Mar 2026 13:07:53 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id SCmmECnGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061674; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mS6DYuTFdH4glH6/mGthCFqaTDBftkuwLBiAxzJBLiQ=; b=qiDtSVqs94cxECjEdlSxRPATJZFnKZXOyLtXdA5Dp0JyL9eOSFQywpBjahGvXNW4IH6Uil vTPqLKUMtuOkoFH6HzAJ/dIgvBhBV7W/WOo8t/F9X2IHBKS30gHhJI2Hr4hMEnuvoAb0IP KqKoZ+O6kJ2LwCM7DU99ez6UrEC422Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061674; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mS6DYuTFdH4glH6/mGthCFqaTDBftkuwLBiAxzJBLiQ=; b=a6A1QzgWt0i9F4JXogVh5bYJvo/CP4QKHWcDVqpdoYfUmKZ13n0PBxAXWBdhZWgXdUKELY aGteFaIjrVysjZBQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061674; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mS6DYuTFdH4glH6/mGthCFqaTDBftkuwLBiAxzJBLiQ=; b=qiDtSVqs94cxECjEdlSxRPATJZFnKZXOyLtXdA5Dp0JyL9eOSFQywpBjahGvXNW4IH6Uil vTPqLKUMtuOkoFH6HzAJ/dIgvBhBV7W/WOo8t/F9X2IHBKS30gHhJI2Hr4hMEnuvoAb0IP KqKoZ+O6kJ2LwCM7DU99ez6UrEC422Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061674; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mS6DYuTFdH4glH6/mGthCFqaTDBftkuwLBiAxzJBLiQ=; b=a6A1QzgWt0i9F4JXogVh5bYJvo/CP4QKHWcDVqpdoYfUmKZ13n0PBxAXWBdhZWgXdUKELY aGteFaIjrVysjZBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 12/22] colo: Hold the BQL while sending ram state Date: Mon, 9 Mar 2026 10:07:17 -0300 Message-ID: <20260309130730.20526-13-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061763079158500 Content-Type: text/plain; charset="utf-8" From: Lukas Straub qemu_savevm_state_complete_precopy() requires that BQL is held. This fixes a crash when running with TCG accel. Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-11-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/colo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index dc7cfa81ef..3297aa593c 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -455,9 +455,8 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, =20 /* Note: device state is saved into buffer */ ret =3D qemu_save_device_state(fb, &local_err); - - bql_unlock(); if (ret < 0) { + bql_unlock(); goto out; } =20 @@ -471,6 +470,7 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, */ qemu_savevm_state_complete_precopy_iterable(s->to_dst_file, false); qemu_savevm_state_end(s->to_dst_file); + bql_unlock(); =20 /* * We need the size of the VMstate data in Secondary side, --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061738; cv=none; d=zohomail.com; s=zohoarc; b=N+JFJc1mEvS+M89cd3Jwxjnuhl4XNN0KIYPVbCAzgPcifK7qwspm0fzs0PFh0UpO6ldsGXD/WwYY2NaPhAG4MyBd/+IWawDNioY55dCkz1l94R8F7vL7mqi3ZZK9vS7AH8qpF5J4Cq4qE0Sj/Ko5y5uPrPPCSD3s6WDPBTPnqKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061738; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Q/nrmjBsud1CgQal/05F5pAtPs+uJsj1aPSBA1S4IAE=; b=go5ahuc7rJ9DmArvXoNZK6NF8y7/KfZpWUUiDtNeX7xItKOxI46459VNN9WdpZUUcF6UoFeAIEWO28BmgRbf9HJg4CnHhiWB1ss+tmJH+jbxIDfBFwHzkoB8JUkpiJSfeZLHYk9/GeReOoYGBRhq+BqtROgILOwIV2SdTrE6hCY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061738586133.19393724714075; Mon, 9 Mar 2026 06:08:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLd-0007CD-7P; Mon, 09 Mar 2026 09:08:39 -0400 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 1vzaLL-0006su-0I for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:20 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLJ-0008As-7t for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:18 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 52A604D219; Mon, 9 Mar 2026 13:07:56 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 252FE3EEF2; Mon, 9 Mar 2026 13:07:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id iDy+NirGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061676; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q/nrmjBsud1CgQal/05F5pAtPs+uJsj1aPSBA1S4IAE=; b=pEfP97j4Axo9PBHmlu3lzq3LCa6Fk8i1MmMaBKl8cw5XqpTrkwiLKCD7hM0sVwoGmqureI nzf1gJ7CX5uTO5vu1gYpOMLnJRcewe7Q7eDkB8xdd57M27sVPs8Up//v7hF+msGXSXGTk6 Dx0cajTEfndinhq5jsreEU2m0MUmHgo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061676; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q/nrmjBsud1CgQal/05F5pAtPs+uJsj1aPSBA1S4IAE=; b=hvf/1VrDMyuXx38IsJ7MuYo9LuMnSCEYSalGbz2ETSFsfKusJCEOtPonoD9xsv2smvsHvF GUSwa2RIqGQVs7AA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=pEfP97j4; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="hvf/1VrD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061676; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q/nrmjBsud1CgQal/05F5pAtPs+uJsj1aPSBA1S4IAE=; b=pEfP97j4Axo9PBHmlu3lzq3LCa6Fk8i1MmMaBKl8cw5XqpTrkwiLKCD7hM0sVwoGmqureI nzf1gJ7CX5uTO5vu1gYpOMLnJRcewe7Q7eDkB8xdd57M27sVPs8Up//v7hF+msGXSXGTk6 Dx0cajTEfndinhq5jsreEU2m0MUmHgo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061676; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q/nrmjBsud1CgQal/05F5pAtPs+uJsj1aPSBA1S4IAE=; b=hvf/1VrDMyuXx38IsJ7MuYo9LuMnSCEYSalGbz2ETSFsfKusJCEOtPonoD9xsv2smvsHvF GUSwa2RIqGQVs7AA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 13/22] colo: Do not hold the BQL while receiving ram state. Date: Mon, 9 Mar 2026 10:07:18 -0300 Message-ID: <20260309130730.20526-14-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 52A604D219 X-Spam-Score: -3.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061739555154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub We only receive ram into the colo cache here and don't touch anything else, so the BQL is not needed here. Move cpu_synchronize_all_states() downwards, before we apply the received checkpoint. It turns out that qemu_system_reset() already calls it for us. Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-12-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/colo.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 3297aa593c..ce02c71d88 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -686,11 +686,7 @@ static void colo_incoming_process_checkpoint(Migration= IncomingState *mis, return; } =20 - bql_lock(); - cpu_synchronize_all_states(); ret =3D qemu_loadvm_state_main(mis->from_src_file, mis, errp); - bql_unlock(); - if (ret < 0) { return; } @@ -733,6 +729,8 @@ static void colo_incoming_process_checkpoint(MigrationI= ncomingState *mis, * With colo we load device vmstate during each checkpoint, on top of * a vm that was already running. Some devices expect a reset before * loading vmstate on such a previously running vm. + * + * NOTE: qemu_system_reset() calls cpu_synchronize_all_states() for us */ qemu_system_reset(SHUTDOWN_CAUSE_SNAPSHOT_LOAD); colo_flush_ram_cache(); --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061761; cv=none; d=zohomail.com; s=zohoarc; b=UqpXHHIZ45bkg4SpeUPMOUqPGfASf5RUBN9dm+kvzuRT3GdSZBrP22cY/gdUrL8n0w8glshTDSPkh0Td4xgOvhWXnXh1j//Td90NF2Ux5rwLF460WHn/NyqysZXH55T+AFwCvwuW3vRQ/mxQQSj12KTLvIplKa/O0K32tGsn5fY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061761; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ONjOhrkIipknNUMs3BCgGta9cnMQP7SnPVvPz17p4uk=; b=JcZljT1XhTPfi6WLn1F4eVp1uFDbfaHbvxm27izIgutX9hDF8hzda6Am8GZe9Lijh2tNoN4dDPLyFjVGkkp0c1Ab7ESh5wwbeGfTanQUEBoQJQjjYZ2zbqSQFIswGe4DShzzua93DYQ5W3pZXSBa6fPTeWXTPZzE5HYQNI6nJY8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061761926869.6450103538783; Mon, 9 Mar 2026 06:09:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLl-0007Lk-Dc; Mon, 09 Mar 2026 09:08:46 -0400 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 1vzaLR-00071Z-22 for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:25 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLO-0008C6-Sv for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:24 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EF6314D221; Mon, 9 Mar 2026 13:07:57 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C147D3EEF2; Mon, 9 Mar 2026 13:07:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id YGxJISzGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061678; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ONjOhrkIipknNUMs3BCgGta9cnMQP7SnPVvPz17p4uk=; b=o76J9VBUW6fSd+WUBsLBeuSSeu9WOFbz+qF9aeM9hOtnNlXbl8Rjsc4EUSiL6pTWrugxRY Kb3wd8QvwtrCH5gXZ4oKb4f3FdmgPSInUqVeoExucB1yvfjghd4aEJdVMlz19RU8VHRmgv 61OzWdu7dqUDrRz8McWKnzmbRh38iQ0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061678; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ONjOhrkIipknNUMs3BCgGta9cnMQP7SnPVvPz17p4uk=; b=iTPoeAewdhSVWtFgpl29N6qC7ExJB/pvzmDQWjX5iXvik4N6s4njEPbzIn20PftuHt+lAl zQzhbqzYxKvg/HDA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=RjvUx0y3; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="p4hER/KG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061677; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ONjOhrkIipknNUMs3BCgGta9cnMQP7SnPVvPz17p4uk=; b=RjvUx0y3ag4idEtXI+vEdOeMUqBc4NipS5AFNq0z/0ljgOXCPdNSQf0+/79U/Izef0WpUm j01FZaY39eY1aVre+lBLqWMyUmduQ3H7HCTKf02UUSTe1BgWrvksPNQXo30nUoeK7ChEaF CX6D1WMEtotm93sfqPsmOsyyMjA+7iE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061677; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ONjOhrkIipknNUMs3BCgGta9cnMQP7SnPVvPz17p4uk=; b=p4hER/KGuIy3gbG+obXaR1ouV/cznJfbSqSHOnvZyU6/4DDesLi4Nu+Iw4d0NSvkWLMw90 Tso8YrI+1a7y6ACA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 14/22] migration-test: Add COLO migration unit test Date: Mon, 9 Mar 2026 10:07:19 -0300 Message-ID: <20260309130730.20526-15-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: EF6314D221 X-Spam-Score: -3.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1773061763184158500 Content-Type: text/plain; charset="utf-8" From: Lukas Straub Add a COLO migration test for COLO migration and failover. Reviewed-by: Fabiano Rosas Tested-by: Fabiano Rosas Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-13-d653fb3b1d80@web.de [remove license boilerplate] Signed-off-by: Fabiano Rosas --- MAINTAINERS | 1 + tests/qtest/meson.build | 7 +- tests/qtest/migration-test.c | 1 + tests/qtest/migration/colo-tests.c | 194 +++++++++++++++++++++++++++++ tests/qtest/migration/framework.h | 5 + 5 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 tests/qtest/migration/colo-tests.c diff --git a/MAINTAINERS b/MAINTAINERS index d8dc4c8d7b..5469cd373a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3886,6 +3886,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 ba9f59d2f8..be4fa627b5 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -372,6 +372,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'), @@ -383,7 +388,7 @@ qtests =3D { 'migration/migration-util.c') + dbus_vmstate1, '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 + migration= _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 0893687174..e582f05c7d 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/col= o-tests.c new file mode 100644 index 0000000000..bc20c92d16 --- /dev/null +++ b/tests/qtest/migration/colo-tests.c @@ -0,0 +1,194 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * QTest testcases for COLO migration + * + * Copyright (c) 2025 Lukas Straub + */ + +#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 int test_colo_common(MigrateCommon *args, + bool failover_during_checkpoint, + bool primary_failover) +{ + QTestState *from, *to; + void *data_hook =3D NULL; + + /* + * For the COLO test, both VMs will run in parallel. Thus both VMs wan= t to + * open the image read/write at the same time. Using read-only=3Don is= not + * possible here, because ide-hd does not support read-only backing im= age. + * + * So use -snapshot, where each qemu instance creates its own writable + * 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; + + /* + * Test with yank with out of band capability since that is how it is + * used in production. + */ + args->start.oob =3D true; + 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, get_dst()); + + 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': 'yank-c= md', " + "'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, !primary_failover); + + return 0; +} + +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_failover); +} + +static void *hook_start_multifd(QTestState *from, QTestState *to) +{ + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); +} + +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_failover); +} + +static void test_colo_plain_primary_failover(char *name, MigrateCommon *ar= gs) +{ + test_colo_plain_common(args, false, true); +} + +static void test_colo_plain_secondary_failover(char *name, MigrateCommon *= args) +{ + test_colo_plain_common(args, false, false); +} + +static void test_colo_multifd_primary_failover(char *name, MigrateCommon *= 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 *arg= s) +{ + test_colo_plain_common(args, true, true); +} + +static void test_colo_plain_secondary_failover_checkpoint(char *name, + MigrateCommon *a= rgs) +{ + test_colo_plain_common(args, true, false); +} + +static void test_colo_multifd_primary_failover_checkpoint(char *name, + MigrateCommon *a= rgs) +{ + test_colo_multifd_common(args, true, true); +} + +static void test_colo_multifd_secondary_failover_checkpoint(char *name, + MigrateCommon = *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_checkpoint", + test_colo_plain_primary_failover_checkpoint); + migration_test_add("/migration/colo/plain/secondary_failover_checkpoin= t", + test_colo_plain_secondary_failover_checkpoint); + + migration_test_add("/migration/colo/multifd/primary_failover_checkpoin= t", + test_colo_multifd_primary_failover_checkpoint); + migration_test_add("/migration/colo/multifd/secondary_failover_checkpo= int", + test_colo_multifd_secondary_failover_checkpoint); +} diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/fram= ework.h index 40984d0493..80eef75893 100644 --- a/tests/qtest/migration/framework.h +++ b/tests/qtest/migration/framework.h @@ -264,5 +264,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 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061787; cv=none; d=zohomail.com; s=zohoarc; b=Xlbb9RjrV3yndbwDbJRUu2a8kgzshZ9RVsSTsJWLV9hl9ajIxmLFmTa+3jrrXdTTQQtmohOHp4C5/1sDw6axqPO/9G/GLE8CquPmYXnMbuqHN6SHwZjRAIE9UC2Xh7qBK5lu7oeKymHGp6fc4SKz5Sx2MgLtKa1NI0ZCGm/b/wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061787; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=m8OnIjR5u/OzUFUYJSThemAXkKhJyODkufc4vRWFuFA=; b=mnl7QMfObQOWZrm5dk4GHc03ABrZ0nGFJ3Ak1JnTRu/rdkCNVCujfLOe4T027k7/+zZhBjH6LdKN3Vtghp/OleeT+006PVDlVSJrh01A/190QFnSomQeCY8wzZftmc7XXu/ht34lC0TU/MTm0ID0abSGGpouZP7yyu6dQlltd44= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061787510534.9798951933952; Mon, 9 Mar 2026 06:09:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLf-0007DU-3b; Mon, 09 Mar 2026 09:08:39 -0400 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 1vzaLU-00077I-SP for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:29 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLQ-0008CF-HJ for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:28 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 15FDE5BDF0; Mon, 9 Mar 2026 13:08:00 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6AB993EEF2; Mon, 9 Mar 2026 13:07:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MHYgDC7GrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:07:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061680; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m8OnIjR5u/OzUFUYJSThemAXkKhJyODkufc4vRWFuFA=; b=tLpfyzwJaV47Pk9LqD5yb4+C4bJwrXFBJZft9AlrBLz9EPQiSMUXba2UkL2CooDLCDYt39 6Z0oxFlfhTkFcimATQWSRa9iQBnSwOFtFd5s5dvXEFuqM1No+CbxLhZUtpnEnogZa2h8U2 S8vjm4nRHUhVUivTTeiZ2Dk6GicfbwU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061680; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m8OnIjR5u/OzUFUYJSThemAXkKhJyODkufc4vRWFuFA=; b=BMBmnWa9m8Z+pPmh2aLelX4sEstn/1FY4Wctf3ysO4yAot06CI14qi9pgIEmifVPmkNJ7Y sz5nEo0POMFzPjBA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061680; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m8OnIjR5u/OzUFUYJSThemAXkKhJyODkufc4vRWFuFA=; b=tLpfyzwJaV47Pk9LqD5yb4+C4bJwrXFBJZft9AlrBLz9EPQiSMUXba2UkL2CooDLCDYt39 6Z0oxFlfhTkFcimATQWSRa9iQBnSwOFtFd5s5dvXEFuqM1No+CbxLhZUtpnEnogZa2h8U2 S8vjm4nRHUhVUivTTeiZ2Dk6GicfbwU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061680; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m8OnIjR5u/OzUFUYJSThemAXkKhJyODkufc4vRWFuFA=; b=BMBmnWa9m8Z+pPmh2aLelX4sEstn/1FY4Wctf3ysO4yAot06CI14qi9pgIEmifVPmkNJ7Y sz5nEo0POMFzPjBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub , Zhang Chen Subject: [PULL 15/22] Convert colo main documentation to restructuredText Date: Mon, 9 Mar 2026 10:07:20 -0300 Message-ID: <20260309130730.20526-16-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -3.30 X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.997]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,web.de]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de,gmail.com]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, suse.de:mid, suse.de:email] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061789451158500 From: Lukas Straub Reviewed-by: Fabiano Rosas Reviewed-by: Zhang Chen Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-14-d653fb3b1d80@web.de [replaced license boilerplate with SPDX line] Signed-off-by: Fabiano Rosas --- MAINTAINERS | 2 +- docs/COLO-FT.txt | 334 ----------------------------------- docs/system/index.rst | 1 + docs/system/qemu-colo.rst | 359 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 361 insertions(+), 335 deletions(-) delete mode 100644 docs/COLO-FT.txt create mode 100644 docs/system/qemu-colo.rst diff --git a/MAINTAINERS b/MAINTAINERS index 5469cd373a..cdc8e780a0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3887,7 +3887,7 @@ 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 +F: docs/system/qemu-colo.rst =20 COLO Proxy M: Zhang Chen diff --git a/docs/COLO-FT.txt b/docs/COLO-FT.txt deleted file mode 100644 index 2283a09c08..0000000000 --- a/docs/COLO-FT.txt +++ /dev/null @@ -1,334 +0,0 @@ -COarse-grained LOck-stepping Virtual Machines for Non-stop Service ----------------------------------------- -Copyright (c) 2016 Intel Corporation -Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. -Copyright (c) 2016 Fujitsu, Corp. - -This work is licensed under the terms of the GNU GPL, version 2 or later. -See the COPYING file in the top-level directory. - -This document gives an overview of COLO's design and how to use it. - -=3D=3D Background =3D=3D -Virtual machine (VM) replication is a well known technique for providing -application-agnostic software-implemented hardware fault tolerance, -also known as "non-stop service". - -COLO (COarse-grained LOck-stepping) is a high availability solution. -Both primary VM (PVM) and secondary VM (SVM) run in parallel. They receive= the -same request from client, and generate response in parallel too. -If the response packets from PVM and SVM are identical, they are released -immediately. Otherwise, a VM checkpoint (on demand) is conducted. - -=3D=3D Architecture =3D=3D - -The architecture of COLO is shown in the diagram below. -It consists of a pair of networked physical nodes: -The primary node running the PVM, and the secondary node running the SVM -to maintain a valid replica of the PVM. -PVM and SVM execute in parallel and generate output of response packets for -client requests according to the application semantics. - -The incoming packets from the client or external network are received by t= he -primary node, and then forwarded to the secondary node, so that both the P= VM -and the SVM are stimulated with the same requests. - -COLO receives the outbound packets from both the PVM and SVM and compares = them -before allowing the output to be sent to clients. - -The SVM is qualified as a valid replica of the PVM, as long as it generates -identical responses to all client requests. Once the differences in the ou= tputs -are detected between the PVM and SVM, COLO withholds transmission of the -outbound packets until it has successfully synchronized the PVM state to t= he SVM. - - Primary Node = Secondary Node -+------------+ +-----------------------+ +------------------------+= +------------+ -| | | HeartBeat +<----->+ HeartBeat |= | | -| Primary VM | +-----------+-----------+ +-----------+------------+= |Secondary VM| -| | | | = | | -| | +-----------|-----------+ +-----------|------------+= | | -| | |QEMU +---v----+ | |QEMU +----v---+ |= | | -| | | |Failover| | | |Failover| |= | | -| | | +--------+ | | +--------+ |= | | -| | | +---------------+ | | +---------------+ |= | | -| | | | VM Checkpoint +-------------->+ VM Checkpoint | |= | | -| | | +---------------+ | | +---------------+ |= | | -|Requests<--------------------------\ /-----------------\ /---------------= ------>Requests| -| | | ^ ^ | | | | |= | | -|Responses+---------------------\ /-|-|------------\ /--------------------= -----+Responses| -| | | | | | | | | | | | | |= | | -| | | +-----------+ | | | | | | | | | | +----------+ |= | | -| | | | COLO disk | | | | | | | | | | | | COLO disk| |= | | -| | | | Manager +---------------------------->| Manager | |= | | -| | | ++----------+ v v | | | | | v v | +---------++ |= | | -| | | |+-----------+-+-+-++| | ++-+--+-+---------+ | |= | | -| | | || COLO Proxy || | | COLO Proxy | | |= | | -| | | || (compare packet || | |(adjust sequence | | |= | | -| | | ||and mirror packet)|| | | and ACK) | | |= | | -| | | |+------------+---+-+| | +-----------------+ | |= | | -+------------+ +-----------------------+ +------------------------+= +------------+ -+------------+ | | | | = +------------+ -| VM Monitor | | | | | = | VM Monitor | -+------------+ | | | | = +------------+ -+---------------------------------------+ +-------------------------= ---------------+ -| Kernel | | | | | Kernel | = | -+---------------------------------------+ +-------------------------= ---------------+ - | | | | - +--------------v+ +---------v---+--+ +------------------+ +v---= ----------+ - | Storage | |External Network| | External Network | | S= torage | - +---------------+ +----------------+ +------------------+ +----= ----------+ - - -=3D=3D Components introduction =3D=3D - -You can see there are several components in COLO's diagram of architecture. -Their functions are described below. - -HeartBeat: -Runs on both the primary and secondary nodes, to periodically check platfo= rm -availability. When the primary node suffers a hardware fail-stop failure, -the heartbeat stops responding, the secondary node will trigger a failover -as soon as it determines the absence. - -COLO disk Manager: -When primary VM writes data into image, the colo disk manager captures thi= s data -and sends it to secondary VM's which makes sure the context of secondary V= M's -image is consistent with the context of primary VM 's image. -For more details, please refer to docs/block-replication.txt. - -Checkpoint/Failover Controller: -Modifications of save/restore flow to realize continuous migration, -to make sure the state of VM in Secondary side is always consistent with V= M in -Primary side. - -COLO Proxy: -Delivers packets to Primary and Secondary, and then compare the responses = from -both side. Then decide whether to start a checkpoint according to some rul= es. -Please refer to docs/colo-proxy.txt for more information. - -Note: -HeartBeat has not been implemented yet, so you need to trigger failover pr= ocess -by using 'x-colo-lost-heartbeat' command. - -=3D=3D COLO operation status =3D=3D - -+-----------------+ -| | -| Start COLO | -| | -+--------+--------+ - | - | Main qmp command: - | migrate-set-capabilities with x-colo - | migrate - | - v -+--------+--------+ -| | -| COLO running | -| | -+--------+--------+ - | - | Main qmp command: - | x-colo-lost-heartbeat - | or - | some error happened - v -+--------+--------+ -| | send qmp event: -| COLO failover | COLO_EXIT -| | -+-----------------+ - -COLO use the qmp command to switch and report operation status. -The diagram just shows the main qmp command, you can get the detail -in test procedure. - -=3D=3D Test procedure =3D=3D -Note: Here we are running both instances on the same host for testing, -change the IP Addresses if you want to run it on two hosts. Initially -127.0.0.1 is the Primary Host and 127.0.0.2 is the Secondary Host. - -=3D=3D Startup qemu =3D=3D -1. Primary: -Note: Initially, $imagefolder/primary.qcow2 needs to be copied to all host= s. -You don't need to change any IP's here, because 0.0.0.0 listens on any -interface. The chardev's with 127.0.0.1 IP's loopback to the local qemu -instance. - -# imagefolder=3D"/mnt/vms/colo-test-primary" - -# qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp 1 -= qmp stdio \ - -device piix3-usb-uhci -device usb-tablet -name primary \ - -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge-hel= per \ - -device rtl8139,id=3De0,netdev=3Dhn0 \ - -chardev socket,id=3Dmirror0,host=3D0.0.0.0,port=3D9003,server=3Don,wai= t=3Doff \ - -chardev socket,id=3Dcompare1,host=3D0.0.0.0,port=3D9004,server=3Don,wa= it=3Don \ - -chardev socket,id=3Dcompare0,host=3D127.0.0.1,port=3D9001,server=3Don,= wait=3Doff \ - -chardev socket,id=3Dcompare0-0,host=3D127.0.0.1,port=3D9001 \ - -chardev socket,id=3Dcompare_out,host=3D127.0.0.1,port=3D9005,server=3D= on,wait=3Doff \ - -chardev socket,id=3Dcompare_out0,host=3D127.0.0.1,port=3D9005 \ - -object filter-mirror,id=3Dm0,netdev=3Dhn0,queue=3Dtx,outdev=3Dmirror0 \ - -object filter-redirector,netdev=3Dhn0,id=3Dredire0,queue=3Drx,indev=3D= compare_out \ - -object filter-redirector,netdev=3Dhn0,id=3Dredire1,queue=3Drx,outdev= =3Dcompare0 \ - -object iothread,id=3Diothread1 \ - -object colo-compare,id=3Dcomp0,primary_in=3Dcompare0-0,secondary_in=3D= compare1,\ -outdev=3Dcompare_out0,iothread=3Diothread1 \ - -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo,vot= e-threshold=3D1,\ -children.0.file.filename=3D$imagefolder/primary.qcow2,children.0.driver=3D= qcow2 -S - -2. Secondary: -Note: Active and hidden images need to be created only once and the -size should be the same as primary.qcow2. Again, you don't need to change -any IP's here, except for the $primary_ip variable. - -# imagefolder=3D"/mnt/vms/colo-test-secondary" -# primary_ip=3D127.0.0.1 - -# qemu-img create -f qcow2 $imagefolder/secondary-active.qcow2 10G - -# qemu-img create -f qcow2 $imagefolder/secondary-hidden.qcow2 10G - -# qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp 1 -= qmp stdio \ - -device piix3-usb-uhci -device usb-tablet -name secondary \ - -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge-hel= per \ - -device rtl8139,id=3De0,netdev=3Dhn0 \ - -chardev socket,id=3Dred0,host=3D$primary_ip,port=3D9003,reconnect-ms= =3D1000 \ - -chardev socket,id=3Dred1,host=3D$primary_ip,port=3D9004,reconnect-ms= =3D1000 \ - -object filter-redirector,id=3Df1,netdev=3Dhn0,queue=3Dtx,indev=3Dred0 \ - -object filter-redirector,id=3Df2,netdev=3Dhn0,queue=3Drx,outdev=3Dred1= \ - -object filter-rewriter,id=3Drew0,netdev=3Dhn0,queue=3Dall \ - -drive if=3Dnone,id=3Dparent0,file.filename=3D$imagefolder/primary.qcow= 2,driver=3Dqcow2 \ - -drive if=3Dnone,id=3Dchilds0,driver=3Dreplication,mode=3Dsecondary,fil= e.driver=3Dqcow2,\ -top-id=3Dcolo-disk0,file.file.filename=3D$imagefolder/secondary-active.qco= w2,\ -file.backing.driver=3Dqcow2,file.backing.file.filename=3D$imagefolder/seco= ndary-hidden.qcow2,\ -file.backing.backing=3Dparent0 \ - -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo,vot= e-threshold=3D1,\ -children.0=3Dchilds0 \ - -incoming tcp:0.0.0.0:9998 - - -3. On Secondary VM's QEMU monitor, issue command -{"execute":"qmp_capabilities"} -{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "nbd-server-start", "arguments": {"addr": {"type": "inet", "da= ta": {"host": "0.0.0.0", "port": "9999"} } } } -{"execute": "nbd-server-add", "arguments": {"device": "parent0", "writable= ": true } } - -Note: - a. The qmp command nbd-server-start and nbd-server-add must be run - before running the qmp command migrate on primary QEMU - b. Active disk, hidden disk and nbd target's length should be the - same. - c. It is better to put active disk and hidden disk in ramdisk. They - will be merged into the parent disk on failover. - -4. On Primary VM's QEMU monitor, issue command: -{"execute":"qmp_capabilities"} -{"execute": "human-monitor-command", "arguments": {"command-line": "drive_= add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file.hos= t=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplicatio= n0"}} -{"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", "nod= e": "replication0" } } -{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "migrate", "arguments": {"uri": "tcp:127.0.0.2:9998" } } - - Note: - a. There should be only one NBD Client for each primary disk. - b. The qmp command line must be run after running qmp command line in - secondary qemu. - -5. After the above steps, you will see, whenever you make changes to PVM, = SVM will be synced. -You can issue command '{ "execute": "migrate-set-parameters" , "arguments"= :{ "x-checkpoint-delay": 2000 } }' -to change the idle checkpoint period time - -6. Failover test -You can kill one of the VMs and Failover on the surviving VM: - -If you killed the Secondary, then follow "Primary Failover". After that, -if you want to resume the replication, follow "Primary resume replication" - -If you killed the Primary, then follow "Secondary Failover". After that, -if you want to resume the replication, follow "Secondary resume replicatio= n" - -=3D=3D Primary Failover =3D=3D -The Secondary died, resume on the Primary - -{"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "ch= ild": "children.1"} } -{"execute": "human-monitor-command", "arguments":{ "command-line": "drive_= del replication0" } } -{"execute": "object-del", "arguments":{ "id": "comp0" } } -{"execute": "object-del", "arguments":{ "id": "iothread1" } } -{"execute": "object-del", "arguments":{ "id": "m0" } } -{"execute": "object-del", "arguments":{ "id": "redire0" } } -{"execute": "object-del", "arguments":{ "id": "redire1" } } -{"execute": "x-colo-lost-heartbeat" } - -=3D=3D Secondary Failover =3D=3D -The Primary died, resume on the Secondary and prepare to become the new Pr= imary - -{"execute": "nbd-server-stop"} -{"execute": "x-colo-lost-heartbeat"} - -{"execute": "object-del", "arguments":{ "id": "f2" } } -{"execute": "object-del", "arguments":{ "id": "f1" } } -{"execute": "chardev-remove", "arguments":{ "id": "red1" } } -{"execute": "chardev-remove", "arguments":{ "id": "red0" } } - -{"execute": "chardev-add", "arguments":{ "id": "mirror0", "backend": {"typ= e": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.0.0.0= ", "port": "9003" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare1", "backend": {"ty= pe": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.0.0.= 0", "port": "9004" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare0", "backend": {"ty= pe": "socket", "data": {"addr": { "type": "inet", "data": { "host": "127.0.= 0.1", "port": "9001" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare0-0", "backend": {"= type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "127.= 0.0.1", "port": "9001" } }, "server": false } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare_out", "backend": {= "type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "127= .0.0.1", "port": "9005" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare_out0", "backend": = {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "12= 7.0.0.1", "port": "9005" } }, "server": false } } } } - -=3D=3D Primary resume replication =3D=3D -Resume replication after new Secondary is up. - -Start the new Secondary (Steps 2 and 3 above), then on the Primary: -{"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job-id"= : "resync", "target": "nbd://127.0.0.2:9999/parent0", "mode": "existing", "= format": "raw", "sync": "full"} } - -Wait until disk is synced, then: -{"execute": "stop"} -{"execute": "block-job-cancel", "arguments":{ "device": "resync"} } - -{"execute": "human-monitor-command", "arguments":{ "command-line": "drive_= add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file.hos= t=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplicatio= n0"}} -{"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "no= de": "replication0" } } - -{"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "id":= "m0", "netdev": "hn0", "queue": "tx", "outdev": "mirror0" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire0", "netdev": "hn0", "queue": "rx", "indev": "compare_out" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire1", "netdev": "hn0", "queue": "rx", "outdev": "compare0" } } -{"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": "iot= hread1" } } -{"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "id": = "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outdev": = "compare_out0", "iothread": "iothread1" } } - -{"execute": "migrate-set-capabilities", "arguments":{ "capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.2:9998" } } - -Note: -If this Primary previously was a Secondary, then we need to insert the -filters before the filter-rewriter by using the -""insert": "before", "position": "id=3Drew0"" Options. See below. - -=3D=3D Secondary resume replication =3D=3D -Become Primary and resume replication after new Secondary is up. Note -that now 127.0.0.1 is the Secondary and 127.0.0.2 is the Primary. - -Start the new Secondary (Steps 2 and 3 above, but with primary_ip=3D127.0.= 0.2), -then on the old Secondary: -{"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job-id"= : "resync", "target": "nbd://127.0.0.1:9999/parent0", "mode": "existing", "= format": "raw", "sync": "full"} } - -Wait until disk is synced, then: -{"execute": "stop"} -{"execute": "block-job-cancel", "arguments":{ "device": "resync" } } - -{"execute": "human-monitor-command", "arguments":{ "command-line": "drive_= add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file.hos= t=3D127.0.0.1,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplicatio= n0"}} -{"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "no= de": "replication0" } } - -{"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "id":= "m0", "insert": "before", "position": "id=3Drew0", "netdev": "hn0", "queue= ": "tx", "outdev": "mirror0" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire0", "insert": "before", "position": "id=3Drew0", "netdev": "hn0= ", "queue": "rx", "indev": "compare_out" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire1", "insert": "before", "position": "id=3Drew0", "netdev": "hn0= ", "queue": "rx", "outdev": "compare0" } } -{"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": "iot= hread1" } } -{"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "id": = "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outdev": = "compare_out0", "iothread": "iothread1" } } - -{"execute": "migrate-set-capabilities", "arguments":{ "capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.1:9998" } } - -=3D=3D TODO =3D=3D -1. Support shared storage. -2. Develop the heartbeat part. -3. Reduce checkpoint VM=E2=80=99s downtime while doing checkpoint. diff --git a/docs/system/index.rst b/docs/system/index.rst index d297a95282..bb948e2993 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -42,3 +42,4 @@ or Hypervisor.Framework. nitro vm-templating sriov + qemu-colo diff --git a/docs/system/qemu-colo.rst b/docs/system/qemu-colo.rst new file mode 100644 index 0000000000..7c771030a1 --- /dev/null +++ b/docs/system/qemu-colo.rst @@ -0,0 +1,359 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +Qemu COLO Fault Tolerance +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +| Copyright (c) 2016 Intel Corporation +| Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. +| Copyright (c) 2016 Fujitsu, Corp. + +This document gives an overview of COLO's design and how to use it. + +Background +---------- +Virtual machine (VM) replication is a well known technique for providing +application-agnostic software-implemented hardware fault tolerance, +also known as "non-stop service". + +COLO (COarse-grained LOck-stepping) is a high availability solution. +Both primary VM (PVM) and secondary VM (SVM) run in parallel. They receive= the +same request from client, and generate response in parallel too. +If the response packets from PVM and SVM are identical, they are released +immediately. Otherwise, a VM checkpoint (on demand) is conducted. + +Architecture +------------ +The architecture of COLO is shown in the diagram below. +It consists of a pair of networked physical nodes: +The primary node running the PVM, and the secondary node running the SVM +to maintain a valid replica of the PVM. +PVM and SVM execute in parallel and generate output of response packets for +client requests according to the application semantics. + +The incoming packets from the client or external network are received by t= he +primary node, and then forwarded to the secondary node, so that both the P= VM +and the SVM are stimulated with the same requests. + +COLO receives the outbound packets from both the PVM and SVM and compares = them +before allowing the output to be sent to clients. + +The SVM is qualified as a valid replica of the PVM, as long as it generates +identical responses to all client requests. Once the differences in the ou= tputs +are detected between the PVM and SVM, COLO withholds transmission of the +outbound packets until it has successfully synchronized the PVM state to t= he SVM. + +Overview:: + + Primary Node = Secondary Node + +------------+ +-----------------------+ +---------------------= ---+ +------------+ + | | | HeartBeat +<----->+ HeartBeat = | | | + | Primary VM | +-----------+-----------+ +-----------+---------= ---+ |Secondary VM| + | | | | = | | + | | +-----------|-----------+ +-----------|---------= ---+ | | + | | |QEMU +---v----+ | |QEMU +----v---+ = | | | + | | | |Failover| | | |Failover| = | | | + | | | +--------+ | | +--------+ = | | | + | | | +---------------+ | | +---------------+ = | | | + | | | | VM Checkpoint +-------------->+ VM Checkpoint | = | | | + | | | +---------------+ | | +---------------+ = | | | + |Requests<--------------------------\ /-----------------\ /-----------= ---------->Requests| + | | | ^ ^ | | | | = | | | + |Responses+---------------------\ /-|-|------------\ /----------------= ---------+Responses| + | | | | | | | | | | | | | = | | | + | | | +-----------+ | | | | | | | | | | +---------= -+ | | | + | | | | COLO disk | | | | | | | | | | | | COLO dis= k| | | | + | | | | Manager +---------------------------->| Manager = | | | | + | | | ++----------+ v v | | | | | v v | +---------= ++ | | | + | | | |+-----------+-+-+-++| | ++-+--+-+---------+ = | | | | + | | | || COLO Proxy || | | COLO Proxy | = | | | | + | | | || (compare packet || | |(adjust sequence | = | | | | + | | | ||and mirror packet)|| | | and ACK) | = | | | | + | | | |+------------+---+-+| | +-----------------+ = | | | | + +------------+ +-----------------------+ +---------------------= ---+ +------------+ + +------------+ | | | = | +------------+ + | VM Monitor | | | | = | | VM Monitor | + +------------+ | | | = | +------------+ + +---------------------------------------+ +---------------------= -------------------+ + | Kernel | | | | | Kernel = | | + +---------------------------------------+ +---------------------= -------------------+ + | | | | + +--------------v+ +---------v---+--+ +------------------+ += v-------------+ + | Storage | |External Network| | External Network | |= Storage | + +---------------+ +----------------+ +------------------+ += --------------+ + +Components introduction +^^^^^^^^^^^^^^^^^^^^^^^ +You can see there are several components in COLO's diagram of architecture. +Their functions are described below. + +HeartBeat +~~~~~~~~~ +Runs on both the primary and secondary nodes, to periodically check platfo= rm +availability. When the primary node suffers a hardware fail-stop failure, +the heartbeat stops responding, the secondary node will trigger a failover +as soon as it determines the absence. + +COLO disk Manager +~~~~~~~~~~~~~~~~~ +When primary VM writes data into image, the colo disk manager captures thi= s data +and sends it to secondary VM's which makes sure the context of secondary V= M's +image is consistent with the context of primary VM 's image. +For more details, please refer to docs/block-replication.txt. + +Checkpoint/Failover Controller +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Modifications of save/restore flow to realize continuous migration, +to make sure the state of VM in Secondary side is always consistent with V= M in +Primary side. + +COLO Proxy +~~~~~~~~~~ +Delivers packets to Primary and Secondary, and then compare the responses = from +both side. Then decide whether to start a checkpoint according to some rul= es. +Please refer to docs/colo-proxy.txt for more information. + +Note: +HeartBeat has not been implemented yet, so you need to trigger failover pr= ocess +by using 'x-colo-lost-heartbeat' command. + +COLO operation status +^^^^^^^^^^^^^^^^^^^^^ + +Overview:: + + +-----------------+ + | | + | Start COLO | + | | + +--------+--------+ + | + | Main qmp command: + | migrate-set-capabilities with x-colo + | migrate + | + v + +--------+--------+ + | | + | COLO running | + | | + +--------+--------+ + | + | Main qmp command: + | x-colo-lost-heartbeat + | or + | some error happened + v + +--------+--------+ + | | send qmp event: + | COLO failover | COLO_EXIT + | | + +-----------------+ + + +COLO use the qmp command to switch and report operation status. +The diagram just shows the main qmp command, you can get the detail +in test procedure. + +Test procedure +-------------- +Note: Here we are running both instances on the same host for testing, +change the IP Addresses if you want to run it on two hosts. Initially +``127.0.0.1`` is the Primary Host and ``127.0.0.2`` is the Secondary Host. + +Startup qemu +^^^^^^^^^^^^ +**1. Primary**: +Note: Initially, ``$imagefolder/primary.qcow2`` needs to be copied to all = hosts. +You don't need to change any IP's here, because ``0.0.0.0`` listens on any +interface. The chardev's with ``127.0.0.1`` IP's loopback to the local qemu +instance:: + + # imagefolder=3D"/mnt/vms/colo-test-primary" + + # qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp= 1 -qmp stdio \ + -device piix3-usb-uhci -device usb-tablet -name primary \ + -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge= -helper \ + -device rtl8139,id=3De0,netdev=3Dhn0 \ + -chardev socket,id=3Dmirror0,host=3D0.0.0.0,port=3D9003,server=3Don= ,wait=3Doff \ + -chardev socket,id=3Dcompare1,host=3D0.0.0.0,port=3D9004,server=3Do= n,wait=3Don \ + -chardev socket,id=3Dcompare0,host=3D127.0.0.1,port=3D9001,server= =3Don,wait=3Doff \ + -chardev socket,id=3Dcompare0-0,host=3D127.0.0.1,port=3D9001 \ + -chardev socket,id=3Dcompare_out,host=3D127.0.0.1,port=3D9005,serve= r=3Don,wait=3Doff \ + -chardev socket,id=3Dcompare_out0,host=3D127.0.0.1,port=3D9005 \ + -object filter-mirror,id=3Dm0,netdev=3Dhn0,queue=3Dtx,outdev=3Dmirr= or0 \ + -object filter-redirector,netdev=3Dhn0,id=3Dredire0,queue=3Drx,inde= v=3Dcompare_out \ + -object filter-redirector,netdev=3Dhn0,id=3Dredire1,queue=3Drx,outd= ev=3Dcompare0 \ + -object iothread,id=3Diothread1 \ + -object colo-compare,id=3Dcomp0,primary_in=3Dcompare0-0,secondary_i= n=3Dcompare1,\ + outdev=3Dcompare_out0,iothread=3Diothread1 \ + -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo= ,vote-threshold=3D1,\ + children.0.file.filename=3D$imagefolder/primary.qcow2,children.0.drive= r=3Dqcow2 -S + + +**2. Secondary**: +Note: Active and hidden images need to be created only once and the +size should be the same as ``primary.qcow2``. Again, you don't need to cha= nge +any IP's here, except for the ``$primary_ip`` variable:: + + # imagefolder=3D"/mnt/vms/colo-test-secondary" + # primary_ip=3D127.0.0.1 + + # qemu-img create -f qcow2 $imagefolder/secondary-active.qcow2 10G + + # qemu-img create -f qcow2 $imagefolder/secondary-hidden.qcow2 10G + + # qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp= 1 -qmp stdio \ + -device piix3-usb-uhci -device usb-tablet -name secondary \ + -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge= -helper \ + -device rtl8139,id=3De0,netdev=3Dhn0 \ + -chardev socket,id=3Dred0,host=3D$primary_ip,port=3D9003,reconnect-= ms=3D1000 \ + -chardev socket,id=3Dred1,host=3D$primary_ip,port=3D9004,reconnect-= ms=3D1000 \ + -object filter-redirector,id=3Df1,netdev=3Dhn0,queue=3Dtx,indev=3Dr= ed0 \ + -object filter-redirector,id=3Df2,netdev=3Dhn0,queue=3Drx,outdev=3D= red1 \ + -object filter-rewriter,id=3Drew0,netdev=3Dhn0,queue=3Dall \ + -drive if=3Dnone,id=3Dparent0,file.filename=3D$imagefolder/primary.= qcow2,driver=3Dqcow2 \ + -drive if=3Dnone,id=3Dchilds0,driver=3Dreplication,mode=3Dsecondary= ,file.driver=3Dqcow2,\ + top-id=3Dcolo-disk0,file.file.filename=3D$imagefolder/secondary-active= .qcow2,\ + file.backing.driver=3Dqcow2,file.backing.file.filename=3D$imagefolder/= secondary-hidden.qcow2,\ + file.backing.backing=3Dparent0 \ + -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo= ,vote-threshold=3D1,\ + children.0=3Dchilds0 \ + -incoming tcp:0.0.0.0:9998 + + +**3.** On Secondary VM's QEMU monitor, issue command:: + + {"execute":"qmp_capabilities"} + {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "nbd-server-start", "arguments": {"addr": {"type": "inet",= "data": {"host": "0.0.0.0", "port": "9999"} } } } + {"execute": "nbd-server-add", "arguments": {"device": "parent0", "writ= able": true } } + +Note: + a. The qmp command ``nbd-server-start`` and ``nbd-server-add`` must be r= un + before running the qmp command migrate on primary QEMU + b. Active disk, hidden disk and nbd target's length should be the + same. + c. It is better to put active disk and hidden disk in ramdisk. They + will be merged into the parent disk on failover. + +**4.** On Primary VM's QEMU monitor, issue command:: + + {"execute":"qmp_capabilities"} + {"execute": "human-monitor-command", "arguments": {"command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} + {"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", = "node": "replication0" } } + {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate", "arguments": {"uri": "tcp:127.0.0.2:9998" } } + +Note: + a. There should be only one NBD Client for each primary disk. + b. The qmp command line must be run after running qmp command line in + secondary qemu. + +**5.** After the above steps, you will see, whenever you make changes to P= VM, SVM will be synced. +You can issue command ``{ "execute": "migrate-set-parameters" , "arguments= ":{ "x-checkpoint-delay": 2000 } }`` +to change the idle checkpoint period time + +Failover test +^^^^^^^^^^^^^ +You can kill one of the VMs and Failover on the surviving VM: + +If you killed the Secondary, then follow "Primary Failover". +After that, if you want to resume the replication, follow "Primary resume = replication" + +If you killed the Primary, then follow "Secondary Failover". +After that, if you want to resume the replication, follow "Secondary resum= e replication" + +Primary Failover +~~~~~~~~~~~~~~~~ +The Secondary died, resume on the Primary:: + + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "child": "children.1"} } + {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_del replication0" } } + {"execute": "object-del", "arguments":{ "id": "comp0" } } + {"execute": "object-del", "arguments":{ "id": "iothread1" } } + {"execute": "object-del", "arguments":{ "id": "m0" } } + {"execute": "object-del", "arguments":{ "id": "redire0" } } + {"execute": "object-del", "arguments":{ "id": "redire1" } } + {"execute": "x-colo-lost-heartbeat" } + +Secondary Failover +~~~~~~~~~~~~~~~~~~ +The Primary died, resume on the Secondary and prepare to become the new Pr= imary:: + + {"execute": "nbd-server-stop"} + {"execute": "x-colo-lost-heartbeat"} + + {"execute": "object-del", "arguments":{ "id": "f2" } } + {"execute": "object-del", "arguments":{ "id": "f1" } } + {"execute": "chardev-remove", "arguments":{ "id": "red1" } } + {"execute": "chardev-remove", "arguments":{ "id": "red0" } } + + {"execute": "chardev-add", "arguments":{ "id": "mirror0", "backend": {= "type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.0= .0.0", "port": "9003" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare1", "backend": = {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.= 0.0.0", "port": "9004" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare0", "backend": = {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "12= 7.0.0.1", "port": "9001" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare0-0", "backend"= : {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "= 127.0.0.1", "port": "9001" } }, "server": false } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare_out", "backend= ": {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": = "127.0.0.1", "port": "9005" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare_out0", "backen= d": {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host":= "127.0.0.1", "port": "9005" } }, "server": false } } } } + +Primary resume replication +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Resume replication after new Secondary is up. + +Start the new Secondary (Steps 2 and 3 above), then on the Primary:: + + {"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job= -id": "resync", "target": "nbd://127.0.0.2:9999/parent0", "mode": "existing= ", "format": "raw", "sync": "full"} } + +Wait until disk is synced, then:: + + {"execute": "stop"} + {"execute": "block-job-cancel", "arguments":{ "device": "resync"} } + + {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "replication0" } } + + {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "= id": "m0", "netdev": "hn0", "queue": "tx", "outdev": "mirror0" } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire0", "netdev": "hn0", "queue": "rx", "indev": "compare_out" = } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire1", "netdev": "hn0", "queue": "rx", "outdev": "compare0" } } + {"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": = "iothread1" } } + {"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "i= d": "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outde= v": "compare_out0", "iothread": "iothread1" } } + + {"execute": "migrate-set-capabilities", "arguments":{ "capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.2:9998" } } + +Note: +If this Primary previously was a Secondary, then we need to insert the +filters before the filter-rewriter by using the +""insert": "before", "position": "id=3Drew0"" Options. See below. + +Secondary resume replication +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Become Primary and resume replication after new Secondary is up. Note +that now 127.0.0.1 is the Secondary and 127.0.0.2 is the Primary. + +Start the new Secondary (Steps 2 and 3 above, but with primary_ip=3D127.0.= 0.2), +then on the old Secondary:: + + {"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job= -id": "resync", "target": "nbd://127.0.0.1:9999/parent0", "mode": "existing= ", "format": "raw", "sync": "full"} } + +Wait until disk is synced, then:: + + {"execute": "stop"} + {"execute": "block-job-cancel", "arguments":{ "device": "resync" } } + + {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.1,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "replication0" } } + + {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "= id": "m0", "insert": "before", "position": "id=3Drew0", "netdev": "hn0", "q= ueue": "tx", "outdev": "mirror0" } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire0", "insert": "before", "position": "id=3Drew0", "netdev": = "hn0", "queue": "rx", "indev": "compare_out" } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire1", "insert": "before", "position": "id=3Drew0", "netdev": = "hn0", "queue": "rx", "outdev": "compare0" } } + {"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": = "iothread1" } } + {"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "i= d": "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outde= v": "compare_out0", "iothread": "iothread1" } } + + {"execute": "migrate-set-capabilities", "arguments":{ "capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.1:9998" } } + +TODO +---- +1. Support shared storage. +2. Develop the heartbeat part. +3. Reduce checkpoint VM=E2=80=99s downtime while doing checkpoint. --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061886; cv=none; d=zohomail.com; s=zohoarc; b=knq56nPehtfEGE1S2KPi8nIwY11vO6LfJfoP09JqUnFTtsm6GrezFHLk5PeNVhq0I4g6OhMbytrrJQKTK282t02ptrjAAE1A7D5Vek1vl9sDgGAuDvHggOI2Fw9Wg9LY2B2SqnWFl5s2aREm9DRU9Vz7R95+aWPu4Oe45MoHD3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061886; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uKddy8cCYYy18kaFlqJdszb/LFZNEu1gP6c8q6HylnI=; b=GU2iVCB8i+4OfbnCeI0jDUEgZl+CuvoYAbmYy4U9fgCc0yr23gCM54282JM/dFOc+nZYh0srNwNu5r/neKx05B6Yp5QX1+G21ZK3al8EfYwNa/WLZMBLgGfptTnfiknq+8lT5a4FSD4ZDnV9v5qyYaSjIaow+sAxEZ9EVOETNlc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061886345303.92600367199725; Mon, 9 Mar 2026 06:11:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLn-0007NJ-69; Mon, 09 Mar 2026 09:08:47 -0400 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 1vzaLX-0007Cg-Nu for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:33 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLU-0008Cw-Ue for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:31 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id ECF824D21A; Mon, 9 Mar 2026 13:08:01 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8484C3EEF2; Mon, 9 Mar 2026 13:08:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id oMlvEjDGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:08:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uKddy8cCYYy18kaFlqJdszb/LFZNEu1gP6c8q6HylnI=; b=gxSOV0I4YzCdMta666jLbN5mIiwl4+TpbOwJgIk782ZUAiY4OKR0vk/9CoLrr2Q8v0oK1C uCkwwg3tZc+Ii8CONlrmfp4geQtSJ8OHhb/JSs58vm09ubUGuDbozA95UBD5Np7tWYhjNq rBCipcI9ZyIk971Zy4AmLGA0phZCePU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061682; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uKddy8cCYYy18kaFlqJdszb/LFZNEu1gP6c8q6HylnI=; b=qFKVBwKnFIhvecdhusT+LS3Ro8762SIue8LI5WKwvtiLIzPz1jw3d8SXxPeu1U53lNoMb3 J+yd/O7UdGg42JBg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061681; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uKddy8cCYYy18kaFlqJdszb/LFZNEu1gP6c8q6HylnI=; b=MifbDqTMmxZKPG+haSSRX4yF03w2VeFcZfDkXechpOsJyI8EAavZs00ibkqhP1MP+EDlAY lYy80mctKM6HT79rdjcT+eff0Hyc5HWhFyD6amV04mDo5cjNxlLVEIzLbfbpPCIu78H7jn Jq0eaN4Poz8CQUeHvufE8X//nx0VmCk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061681; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uKddy8cCYYy18kaFlqJdszb/LFZNEu1gP6c8q6HylnI=; b=qVIWgi2tIns4mcxeUxlpfI67XcgPM9l1aEq+XWR9XjnKA5Y2bbjsk0VClxvQkUnyEznrG4 T3h4z8QaNRd1+/Bw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub , Zhang Chen Subject: [PULL 16/22] qemu-colo.rst: Miscellaneous changes Date: Mon, 9 Mar 2026 10:07:21 -0300 Message-ID: <20260309130730.20526-17-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.996]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[gmail.com,web.de]; RCVD_TLS_ALL(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de,gmail.com]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_THREE(0.00)[4]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid, suse.de:email, imap1.dmz-prg2.suse.org:helo] X-Spam-Score: -3.30 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) (identity @suse.de) X-ZM-MESSAGEID: 1773061887953158500 From: Lukas Straub Reviewed-by: Fabiano Rosas Reviewed-by: Zhang Chen Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-15-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- docs/system/qemu-colo.rst | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/system/qemu-colo.rst b/docs/system/qemu-colo.rst index 7c771030a1..ec73677e5e 100644 --- a/docs/system/qemu-colo.rst +++ b/docs/system/qemu-colo.rst @@ -3,10 +3,6 @@ Qemu COLO Fault Tolerance =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D =20 -| Copyright (c) 2016 Intel Corporation -| Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. -| Copyright (c) 2016 Fujitsu, Corp. - This document gives an overview of COLO's design and how to use it. =20 Background @@ -81,8 +77,8 @@ Overview:: | Storage | |External Network| | External Network | |= Storage | +---------------+ +----------------+ +------------------+ += --------------+ =20 -Components introduction -^^^^^^^^^^^^^^^^^^^^^^^ +Components +^^^^^^^^^^ You can see there are several components in COLO's diagram of architecture. Their functions are described below. =20 @@ -156,14 +152,21 @@ in test procedure. =20 Test procedure -------------- -Note: Here we are running both instances on the same host for testing, + +Setup +^^^^^ + +Here we are running both instances on the same host for testing, change the IP Addresses if you want to run it on two hosts. Initially ``127.0.0.1`` is the Primary Host and ``127.0.0.2`` is the Secondary Host. =20 +COLO uses double the guest ram size on the secondary side. The Qemu version +should be the same on both hosts. + Startup qemu ^^^^^^^^^^^^ **1. Primary**: -Note: Initially, ``$imagefolder/primary.qcow2`` needs to be copied to all = hosts. +Initially, ``$imagefolder/primary.qcow2`` needs to be copied to all hosts. You don't need to change any IP's here, because ``0.0.0.0`` listens on any interface. The chardev's with ``127.0.0.1`` IP's loopback to the local qemu instance:: @@ -191,7 +194,7 @@ instance:: =20 =20 **2. Secondary**: -Note: Active and hidden images need to be created only once and the +Active and hidden images need to be created only once and the size should be the same as ``primary.qcow2``. Again, you don't need to cha= nge any IP's here, except for the ``$primary_ip`` variable:: =20 @@ -352,8 +355,6 @@ Wait until disk is synced, then:: {"execute": "migrate-set-capabilities", "arguments":{ "capabilities": = [ {"capability": "x-colo", "state": true } ] } } {"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.1:9998" } } =20 -TODO ----- -1. Support shared storage. -2. Develop the heartbeat part. -3. Reduce checkpoint VM=E2=80=99s downtime while doing checkpoint. +| Copyright (c) 2016 Intel Corporation +| Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. +| Copyright (c) 2016 Fujitsu, Corp. --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061877; cv=none; d=zohomail.com; s=zohoarc; b=lj6vMNRU0BVFVnC35VlG/ipcxU4MhLyrfno/qP68oI/0CvTu1DiqzLNGMJiy/qoOk0K9n/UNMrWrqwwa2olfz/2jCCMHVmeLTWNYGY/SSA27nK17yVnjTHuT9vN2OyJJu9DhI85mhjLFMKPHWsKNyRveGjrFwof4DmkwyxzFiq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061877; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=h13tJ1xejAgyEUU76A0g3yFwe/yE9nt3DxGNX20EZWs=; b=NBWGIqJGQ1Ejhn3pvD3iHqtNh9hGTxWb/SSku1krI5q+xmeleEFd8EmW7Zl4PpBT5BrKuAAUIn+vRTZqpHHI/N/kNjxpP6sEuaIzuU79UA5rrdJsL2i8XRHMuDtOW21cnSY9qZuIzVCHAVnoFngUigm1PIT0oGzKxTQpPyNZepA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061877726980.987095942135; Mon, 9 Mar 2026 06:11:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLt-0007Y6-78; Mon, 09 Mar 2026 09:08:53 -0400 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 1vzaLa-0007ET-FV for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:37 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLY-0008DU-Rm for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:34 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D30385BE00; Mon, 9 Mar 2026 13:08:03 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 65EED3EEF2; Mon, 9 Mar 2026 13:08:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id kLsDCzLGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:08:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061683; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h13tJ1xejAgyEUU76A0g3yFwe/yE9nt3DxGNX20EZWs=; b=Z3Rj1SKAh0vAx/3I5qiUCe1MejY2cjd9cXUg7OTODX9qh+NO1IgxivH+Wr1FANykWrZCc4 +GBzNgoz5UsYpBhd377TRExX+3jwLzNihHcc3gUHh/RcZJTwz0O1Kfj3eCBVPs8x5YDnzL CwH+jY1k8QhPt6oZWLJPgFeAkU9KU2Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061683; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h13tJ1xejAgyEUU76A0g3yFwe/yE9nt3DxGNX20EZWs=; b=oNxuVMCaj5aZHdAdhefjl+ycy6cKx3Sgxe6bgg/V9poRRxhHB4mSKtM2V6KHZCJFTdG2wA EgZcn51dbkD/2VBA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061683; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h13tJ1xejAgyEUU76A0g3yFwe/yE9nt3DxGNX20EZWs=; b=Z3Rj1SKAh0vAx/3I5qiUCe1MejY2cjd9cXUg7OTODX9qh+NO1IgxivH+Wr1FANykWrZCc4 +GBzNgoz5UsYpBhd377TRExX+3jwLzNihHcc3gUHh/RcZJTwz0O1Kfj3eCBVPs8x5YDnzL CwH+jY1k8QhPt6oZWLJPgFeAkU9KU2Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061683; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h13tJ1xejAgyEUU76A0g3yFwe/yE9nt3DxGNX20EZWs=; b=oNxuVMCaj5aZHdAdhefjl+ycy6cKx3Sgxe6bgg/V9poRRxhHB4mSKtM2V6KHZCJFTdG2wA EgZcn51dbkD/2VBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub , Zhang Chen Subject: [PULL 17/22] qemu-colo.rst: Add my copyright Date: Mon, 9 Mar 2026 10:07:22 -0300 Message-ID: <20260309130730.20526-18-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[redhat.com,web.de,gmail.com]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FREEMAIL_ENVRCPT(0.00)[gmail.com,web.de] Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061879711154101 Content-Type: text/plain; charset="utf-8" From: Lukas Straub I have so far contributed 61 commits to the colo project, waranting the addition of my copyright to this file. Reviewed-by: Zhang Chen Reviewed-by: Fabiano Rosas Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-16-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- docs/system/qemu-colo.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/system/qemu-colo.rst b/docs/system/qemu-colo.rst index ec73677e5e..671c56448e 100644 --- a/docs/system/qemu-colo.rst +++ b/docs/system/qemu-colo.rst @@ -358,3 +358,4 @@ Wait until disk is synced, then:: | Copyright (c) 2016 Intel Corporation | Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. | Copyright (c) 2016 Fujitsu, Corp. +| Copyright (c) 2026 Lukas Straub --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061895; cv=none; d=zohomail.com; s=zohoarc; b=B04grDb2ipFGJU5kPQv0jjWEe3bEqu9hqpFUZJvmASFZhpR7VUazKVlz4UarUdnMak9ZN727k4mR9gkI3TuHK79x2qqw/OXvuPVGcTGXi2Q9+d6JCgqX+5zb8/iZAOwl0L6uRmavpY93eBHNulgCvwpm/qssHjCpSL03E8YL3DI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061895; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sb0wOxDlYw2qEo06xo1VesM/lciM5QCiUq/6uJ4HNtk=; b=GZSh5heWgqoWfutKDAXLSlN6TfTXo2J3QHYn/1lLNlR3wnSfyD/7F/guQehj9G3nUq9/UK92IpN+ncSfrLswQ0PHo/mSde3fTs/D4+W5hEJ55a7gBL2e4+NNptbUa+ly8ag72Dkp6iC0ZPYeGySd0miFir3UkGIVVbplExVudfU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061895814997.7786851150594; Mon, 9 Mar 2026 06:11:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLn-0007NN-7J; Mon, 09 Mar 2026 09:08:47 -0400 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 1vzaLd-0007FP-7H for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:39 -0400 Received: from smtp-out1.suse.de ([195.135.223.130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLb-0008Dl-B9 for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:36 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 79CF14D21E; Mon, 9 Mar 2026 13:08:05 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4C14C3EEF2; Mon, 9 Mar 2026 13:08:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MPuiBDTGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:08:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061685; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sb0wOxDlYw2qEo06xo1VesM/lciM5QCiUq/6uJ4HNtk=; b=ByvzfRizL7ocLytJqpjURgxjg1S9RCHT27jZmXu24CQwsEBnCnoO8ydFBwISPr/Ol9n5wL V72F80u2jXCM+s5qQsq0pCJSeoX5SQq6zh8wq3aABzvmNArZh7FRh+/zxnQwbp6Wbo187Z VvTpvQyNw1y7tIuNi794a7sRJZwViqc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061685; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sb0wOxDlYw2qEo06xo1VesM/lciM5QCiUq/6uJ4HNtk=; b=/Nx2YnA9YNh9pRGoxH/Qnaqlt5ouk4MhYnLdjdA4rMVbTIQ4mmLuvD2vhZw32Hh5K+hWbc 4EhAJXxO15VpLkAw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ByvzfRiz; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="/Nx2YnA9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061685; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sb0wOxDlYw2qEo06xo1VesM/lciM5QCiUq/6uJ4HNtk=; b=ByvzfRizL7ocLytJqpjURgxjg1S9RCHT27jZmXu24CQwsEBnCnoO8ydFBwISPr/Ol9n5wL V72F80u2jXCM+s5qQsq0pCJSeoX5SQq6zh8wq3aABzvmNArZh7FRh+/zxnQwbp6Wbo187Z VvTpvQyNw1y7tIuNi794a7sRJZwViqc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061685; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sb0wOxDlYw2qEo06xo1VesM/lciM5QCiUq/6uJ4HNtk=; b=/Nx2YnA9YNh9pRGoxH/Qnaqlt5ouk4MhYnLdjdA4rMVbTIQ4mmLuvD2vhZw32Hh5K+hWbc 4EhAJXxO15VpLkAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 18/22] qemu-colo.rst: Simplify the block replication setup Date: Mon, 9 Mar 2026 10:07:23 -0300 Message-ID: <20260309130730.20526-19-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 79CF14D21E X-Spam-Score: -3.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061896034158500 Content-Type: text/plain; charset="utf-8" From: Lukas Straub On the primary side we don't actually need the replication block driver, since it only passes trough all IO. So simplify the setup and also use 'blockdev-add' instead of 'human-monitor-command'. This is how my clients use colo in production. Reviewed-by: Fabiano Rosas Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-17-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- docs/system/qemu-colo.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/system/qemu-colo.rst b/docs/system/qemu-colo.rst index 671c56448e..a8f608b95e 100644 --- a/docs/system/qemu-colo.rst +++ b/docs/system/qemu-colo.rst @@ -242,8 +242,8 @@ Note: **4.** On Primary VM's QEMU monitor, issue command:: =20 {"execute":"qmp_capabilities"} - {"execute": "human-monitor-command", "arguments": {"command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} - {"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", = "node": "replication0" } } + {"execute": "blockdev-add", "arguments": {"driver": "nbd", "node-name"= : "nbd0", "server": {"type": "inet", "host": "127.0.0.2", "port": "9999"}, = "export": "parent0", "detect-zeroes": "on"} } + {"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", = "node": "nbd0" } } {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "x-colo", "state": true } ] } } {"execute": "migrate", "arguments": {"uri": "tcp:127.0.0.2:9998" } } =20 @@ -271,7 +271,7 @@ Primary Failover The Secondary died, resume on the Primary:: =20 {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "child": "children.1"} } - {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_del replication0" } } + {"execute": "blockdev-del", "arguments": {"node-name": "nbd0"} } {"execute": "object-del", "arguments":{ "id": "comp0" } } {"execute": "object-del", "arguments":{ "id": "iothread1" } } {"execute": "object-del", "arguments":{ "id": "m0" } } @@ -311,8 +311,8 @@ Wait until disk is synced, then:: {"execute": "stop"} {"execute": "block-job-cancel", "arguments":{ "device": "resync"} } =20 - {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} - {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "replication0" } } + {"execute": "blockdev-add", "arguments": {"driver": "nbd", "node-name"= : "nbd0", "server": {"type": "inet", "host": "127.0.0.2", "port": "9999"}, = "export": "parent0", "detect-zeroes": "on"} } + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "nbd0" } } =20 {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "= id": "m0", "netdev": "hn0", "queue": "tx", "outdev": "mirror0" } } {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire0", "netdev": "hn0", "queue": "rx", "indev": "compare_out" = } } @@ -343,8 +343,8 @@ Wait until disk is synced, then:: {"execute": "stop"} {"execute": "block-job-cancel", "arguments":{ "device": "resync" } } =20 - {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.1,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} - {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "replication0" } } + {"execute": "blockdev-add", "arguments": {"driver": "nbd", "node-name"= : "nbd0", "server": {"type": "inet", "host": "127.0.0.1", "port": "9999"}, = "export": "parent0", "detect-zeroes": "on"} } + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "nbd0" } } =20 {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "= id": "m0", "insert": "before", "position": "id=3Drew0", "netdev": "hn0", "q= ueue": "tx", "outdev": "mirror0" } } {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire0", "insert": "before", "position": "id=3Drew0", "netdev": = "hn0", "queue": "rx", "indev": "compare_out" } } --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061899; cv=none; d=zohomail.com; s=zohoarc; b=A5ITIiyK9LwCfXtOljSt214y7zl/k/DONAJvtn6Fau+c+IZMNd4dzU+zJM1fdZFUcfRmbxRT/diYORjJhyGb/pqhcGAEECHXHUiWNfrLwqfQtGvO9lY+JJYwm7atTbC+3+W+sa/YuIwfCD49tjdN6pF59PmHRBb/w6bTsIIzBtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061899; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0bGmpbAJ6M6BRMeEwJeaJpl4XtgApL77wba2+Xy6hEc=; b=Rm2lz/8Gh8C1ufmnVjBMgcrKEue0clRTfuaO+1O17djCd5MbdWM77uwcufKZ/dPPruKDu5Fo2MgowvgrtEUARbOZc3mIIIXeCQxBuMCzA8usLJek7+IGG58lja6pp5XUoG36b7v/ZOb904PLGxOVN0Gb6jSoQI8Me57hJ3jEhIs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061899183817.8143110921259; Mon, 9 Mar 2026 06:11:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLt-0007Y8-6c; Mon, 09 Mar 2026 09:08:53 -0400 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 1vzaLg-0007Ij-9W for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:40 -0400 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLe-0008FV-DA for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:40 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 23D0B5BDC1; Mon, 9 Mar 2026 13:08:07 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E7F223EEF2; Mon, 9 Mar 2026 13:08:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id QI28KjXGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:08:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061687; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bGmpbAJ6M6BRMeEwJeaJpl4XtgApL77wba2+Xy6hEc=; b=yV8YjQXCmpkqyusaR4bXq69ztjQOsxikKU1HenRHbR3jILJRlia2lPX4WScK3LZ7NW+kT5 eeWRatFox+1kACu4WF2t7nO7G0yBWwxLUM1N9221rkpD7W7jTztCraHzxtn58pB2o+Aqrh PJ+dIYyoUInsNepXnbTl2Ix9Dd5w1QU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061687; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bGmpbAJ6M6BRMeEwJeaJpl4XtgApL77wba2+Xy6hEc=; b=nolV4Q1HDIdeynkk+03cxfekoBZKC1iXfUxx/gc8ce0r3VX7HPmuY9aXQ3adEKq/yzBHBo t1LhEbB6gkRSQ7AQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=yV8YjQXC; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=nolV4Q1H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061687; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bGmpbAJ6M6BRMeEwJeaJpl4XtgApL77wba2+Xy6hEc=; b=yV8YjQXCmpkqyusaR4bXq69ztjQOsxikKU1HenRHbR3jILJRlia2lPX4WScK3LZ7NW+kT5 eeWRatFox+1kACu4WF2t7nO7G0yBWwxLUM1N9221rkpD7W7jTztCraHzxtn58pB2o+Aqrh PJ+dIYyoUInsNepXnbTl2Ix9Dd5w1QU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061687; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bGmpbAJ6M6BRMeEwJeaJpl4XtgApL77wba2+Xy6hEc=; b=nolV4Q1HDIdeynkk+03cxfekoBZKC1iXfUxx/gc8ce0r3VX7HPmuY9aXQ3adEKq/yzBHBo t1LhEbB6gkRSQ7AQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 19/22] multifd: Fix hang if send thread errors during sync Date: Mon, 9 Mar 2026 10:07:24 -0300 Message-ID: <20260309130730.20526-20-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 23D0B5BDC1 X-Spam-Score: -3.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061900064154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub When a send thread encounters an error (as is the case with yank), it sets multifd_send_state->exiting and the other threads exit too. This races with multifd_send_sync_main() which now hangs at qemu_sem_wait(&p->sem_sync) in multifd_send_sync_main() line 647 as it waits for threads that have exited. Fix this by kicking the semaphores when exiting the send threads. I encountered this hang when stress testing the colo unit test, though I was unable to write a migration test to reliably hit this. Reviewed-by: Peter Xu Signed-off-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-18-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/multifd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/migration/multifd.c b/migration/multifd.c index 2193088996..8b9ed84805 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -772,9 +772,14 @@ out: assert(local_err); trace_multifd_send_error(p->id); multifd_send_error_propagate(local_err); - multifd_send_kick_main(p); } =20 + /* + * Always kick the main thread: The main thread might wait on this thr= ead + * while another thread encounters an error and signals this thread to= exit. + */ + multifd_send_kick_main(p); + rcu_unregister_thread(); trace_multifd_send_thread_end(p->id, p->packets_sent); =20 --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061836; cv=none; d=zohomail.com; s=zohoarc; b=eCgPtlv22X7U8Ykb0Iwq9vbAsgCTkGRw5L/1iv7P4FGhbZi2dJJXoXdRynOUlpwqZr9Jm3saF8WeQJhUWPbkjfo8/iU79AJdc5Z7e6zto54PInMFovddZHZ+ZJGNNrEjYkC7d81ZB14Cifd0RGlUMNba0xIKz76+q0YO1l/+WRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061836; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zY4vhXW1YV+fVtNWpUYRbmkk4HN9uMjW7kAYijFlluA=; b=mLqXOPNt0/lKBERS5RllGRH3mSq0Wbfl0EsmdR0RjGJsokjz47+/64jwsv24yNa/R3LDnvsuSNJFRp5nFOLd2jm1sSge4cWQoXjkOTkj6pWDOtKRWvhNCpqAfSs3ye8/G3u0MxLiLJM7HlWIdIdkqknkcxMsl2np3gGaPnENfSg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061836503129.46673997035964; Mon, 9 Mar 2026 06:10:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLu-0007cd-B1; Mon, 09 Mar 2026 09:08:54 -0400 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 1vzaLl-0007Mg-K7 for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:46 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLk-0008HG-1d for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:45 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BF88C5BE07; Mon, 9 Mar 2026 13:08:08 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 918E33EEF2; Mon, 9 Mar 2026 13:08:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id yI+rFTfGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:08:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zY4vhXW1YV+fVtNWpUYRbmkk4HN9uMjW7kAYijFlluA=; b=sbPmD8pZcNERO2+5royTX0eEXK3bCmIpdbtSiShm8+jqqEKig0UTbtOpnSP2YkIRqige0C ji27fSoeY+9QJ6mA2Tn1V303f+cjsCHA6vlRSDaoaq9ixBhjYOxqcksG8R6lvQdgQaW3Gw 5ByQmSs9Te/VQQRU7DAg05jz4o8Gumk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zY4vhXW1YV+fVtNWpUYRbmkk4HN9uMjW7kAYijFlluA=; b=oZiBIvIIWnG9JI1BvJMdvsdf+7WGw51R4WJxlXRRxzVsduBfNjsHGtYrKqvTt7K15f6MS9 RN75oq2XRyb5sDBA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=sbPmD8pZ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=oZiBIvII DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zY4vhXW1YV+fVtNWpUYRbmkk4HN9uMjW7kAYijFlluA=; b=sbPmD8pZcNERO2+5royTX0eEXK3bCmIpdbtSiShm8+jqqEKig0UTbtOpnSP2YkIRqige0C ji27fSoeY+9QJ6mA2Tn1V303f+cjsCHA6vlRSDaoaq9ixBhjYOxqcksG8R6lvQdgQaW3Gw 5ByQmSs9Te/VQQRU7DAg05jz4o8Gumk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061688; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zY4vhXW1YV+fVtNWpUYRbmkk4HN9uMjW7kAYijFlluA=; b=oZiBIvIIWnG9JI1BvJMdvsdf+7WGw51R4WJxlXRRxzVsduBfNjsHGtYrKqvTt7K15f6MS9 RN75oq2XRyb5sDBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 20/22] colo: Use file lock in primary_vm_do_failover() Date: Mon, 9 Mar 2026 10:07:25 -0300 Message-ID: <20260309130730.20526-21-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,suse.de:email]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Action: no action X-Spam-Score: -3.01 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: BF88C5BE07 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061839096154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub Take the file lock since s->to_dst_file and s->rp_state.from_dst_file may be changed in the migration thread. Signed-off-by: Lukas Straub Reviewed-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-19-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/colo.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index ce02c71d88..dc47d03874 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -173,11 +173,13 @@ static void primary_vm_do_failover(void) * The s->rp_state.from_dst_file and s->to_dst_file may use the * same fd, but we still shutdown the fd for twice, it is harmless. */ - if (s->to_dst_file) { - qemu_file_shutdown(s->to_dst_file); - } - if (s->rp_state.from_dst_file) { - qemu_file_shutdown(s->rp_state.from_dst_file); + WITH_QEMU_LOCK_GUARD(&s->qemu_file_lock) { + if (s->to_dst_file) { + qemu_file_shutdown(s->to_dst_file); + } + if (s->rp_state.from_dst_file) { + qemu_file_shutdown(s->rp_state.from_dst_file); + } } =20 old_state =3D failover_set_state(FAILOVER_STATUS_ACTIVE, --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061851; cv=none; d=zohomail.com; s=zohoarc; b=nBwqOQ0nH0PqaHQFlmaXhQaxVVEwkTSw5VfGfbF7cWbD2NSx39GvSD5xrfxI9oGoaY6JGpgKeU2lsULwrkQmZ+/i80Xk3UE51GuOnemS9W/139lSH4tyUHsATOUziivED31a/UW2WI/uKYVLL/SedzeuQvogGGpwmHVVR4hZROk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061851; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=70zwbdfRBpO2Ij6TFJP4Y52oBVySwONpFxrtcgTAyVo=; b=Nd7tp1sDF9YvpWnnN9TI3pkWnzF8F9qP9ONv3tZzKz2F9rzCFYvjyNF5ccXDGTRBPkxPrtpFpDrLrJUQaA/Q56aqBTztqmY9kZVXknvZp8KESDjjcQp9ogvhex4VOzqG4XQTd3iNjCs5sZQXuB4Wr6+l6NwyJqHbkmRWnTE9S9s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177306185103986.26759890611004; Mon, 9 Mar 2026 06:10:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLt-0007XR-4J; Mon, 09 Mar 2026 09:08:53 -0400 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 1vzaLk-0007LX-2N for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:45 -0400 Received: from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLh-0008Fz-Dp for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:43 -0400 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 69CF34D21F; Mon, 9 Mar 2026 13:08:10 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3A5453EEF2; Mon, 9 Mar 2026 13:08:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +P1FADnGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:08:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061690; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=70zwbdfRBpO2Ij6TFJP4Y52oBVySwONpFxrtcgTAyVo=; b=OCRDIjIHPd4AhEjg8doz0YdFAdWR4foJ72aY95JXQGQ+/v9pWSdQmHqXNU6Ei5twml4tcS 2WaaQ1Fctf5p/8ICHrUtXPK2C7VXQHJjv/O9fwRDIMV1yp54Kgc8aOmrRp0aUlmqep8EjJ EZcrZVzVCFjHLWYFfLRRZKKoUUZ0XFY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061690; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=70zwbdfRBpO2Ij6TFJP4Y52oBVySwONpFxrtcgTAyVo=; b=hisp3/Tdsww4xZ0B6P6w7wYm6544O14GoeP2egAVe4w6qCRfwSt4eQL+GiG16SGns6tQ6l 6nNscxoxhSbAugAw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=OCRDIjIH; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="hisp3/Td" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061690; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=70zwbdfRBpO2Ij6TFJP4Y52oBVySwONpFxrtcgTAyVo=; b=OCRDIjIHPd4AhEjg8doz0YdFAdWR4foJ72aY95JXQGQ+/v9pWSdQmHqXNU6Ei5twml4tcS 2WaaQ1Fctf5p/8ICHrUtXPK2C7VXQHJjv/O9fwRDIMV1yp54Kgc8aOmrRp0aUlmqep8EjJ EZcrZVzVCFjHLWYFfLRRZKKoUUZ0XFY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061690; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=70zwbdfRBpO2Ij6TFJP4Y52oBVySwONpFxrtcgTAyVo=; b=hisp3/Tdsww4xZ0B6P6w7wYm6544O14GoeP2egAVe4w6qCRfwSt4eQL+GiG16SGns6tQ6l 6nNscxoxhSbAugAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 21/22] migration: Keep s->rp_state.from_dst_file open until migration ends Date: Mon, 9 Mar 2026 10:07:26 -0300 Message-ID: <20260309130730.20526-22-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 69CF34D21F X-Spam-Score: -3.01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:1; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061853415154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub This will be used in the next patch to allow COLO to reuse the return path. Signed-off-by: Lukas Straub Reviewed-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-20-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- migration/migration.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 53bf87c3fc..f949708629 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -97,7 +97,8 @@ static GSList *migration_blockers[MIG_MODE__MAX]; =20 static bool migration_object_check(MigrationState *ms, Error **errp); static bool migration_switchover_start(MigrationState *s, Error **errp); -static bool close_return_path_on_source(MigrationState *s); +static bool stop_return_path_thread_on_source(MigrationState *s); +static void migration_release_dst_files(MigrationState *ms); static void migration_completion_end(MigrationState *s); =20 static void migration_downtime_start(MigrationState *s) @@ -1281,7 +1282,8 @@ static void migration_cleanup(MigrationState *s) cpr_state_close(); cpr_transfer_source_destroy(s); =20 - close_return_path_on_source(s); + stop_return_path_thread_on_source(s); + migration_release_dst_files(s); =20 if (s->migration_thread_running) { bql_unlock(); @@ -2217,6 +2219,7 @@ static void migration_release_dst_files(MigrationStat= e *ms) * locking needed because this qemufile should only be managed by * return path thread. */ + assert(!ms->rp_state.rp_thread_created); if (ms->postcopy_qemufile_src) { migration_ioc_unregister_yank_from_file(ms->postcopy_qemufile_src); qemu_file_shutdown(ms->postcopy_qemufile_src); @@ -2224,7 +2227,9 @@ static void migration_release_dst_files(MigrationStat= e *ms) ms->postcopy_qemufile_src =3D NULL; } =20 - qemu_fclose(file); + if (file) { + qemu_fclose(file); + } } =20 /* @@ -2410,7 +2415,7 @@ static void open_return_path_on_source(MigrationState= *ms) } =20 /* Return true if error detected, or false otherwise */ -static bool close_return_path_on_source(MigrationState *ms) +static bool stop_return_path_thread_on_source(MigrationState *ms) { if (!ms->rp_state.rp_thread_created) { return false; @@ -2432,7 +2437,6 @@ static bool close_return_path_on_source(MigrationStat= e *ms) =20 qemu_thread_join(&ms->rp_state.rp_thread); ms->rp_state.rp_thread_created =3D false; - migration_release_dst_files(ms); trace_migration_return_path_end_after(); =20 /* Return path will persist the error in MigrationState when quit */ @@ -2795,7 +2799,7 @@ static void migration_completion(MigrationState *s) goto fail; } =20 - if (close_return_path_on_source(s)) { + if (stop_return_path_thread_on_source(s)) { goto fail; } =20 @@ -2949,7 +2953,8 @@ static MigThrError postcopy_pause(MigrationState *s) * path and just wait for the thread to finish. It will be * re-created when we resume. */ - close_return_path_on_source(s); + stop_return_path_thread_on_source(s); + migration_release_dst_files(s); =20 /* * Current channel is possibly broken. Release it. Note that this= is --=20 2.51.0 From nobody Sat Apr 11 21:30:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1773061871; cv=none; d=zohomail.com; s=zohoarc; b=V3AX5fb8Hv85/tt0yd6Hi46pQj4iBS1mycSqh0kPDfjHQ3Vqnjj3BWaaSiVHAEbj24pURnU53ajG734Sg3E0t8a3AGDHu4ZXKPd5tfdxb7QovmptPNGQV832SNaPEecigPweBULmdxIeJOgje5M+qU4JlBmD057dS3T6T36V/0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773061871; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xoT4sJsTJCVUrSe47rt/c9mPM/gGJe7LdEyAE9/m3NE=; b=i48Xlt/fDWJm6IAUpFtwgKnKdku1ghUtbeOVU5uoVU6ChVWRM2QaETYz3JEuGcQA79/DmgWDyDx9yosvEoMgk77rZ3hKfnAkOhEapuKuq0UEFippD96LhE5v1en/gRk/o8mMXbn4VkDOG16sioJ6M4sCjl9bngHf0PGklKGBKL8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773061871620386.3293178857018; Mon, 9 Mar 2026 06:11:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzaLx-0007wf-TJ; Mon, 09 Mar 2026 09:08:57 -0400 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 1vzaLt-0007Y4-3g for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:53 -0400 Received: from smtp-out2.suse.de ([2a07:de40:b251:101:10:150:64:2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzaLp-0008Lu-FP for qemu-devel@nongnu.org; Mon, 09 Mar 2026 09:08:51 -0400 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0F8C45BD8F; Mon, 9 Mar 2026 13:08:12 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D6C1D3EEF2; Mon, 9 Mar 2026 13:08:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id iPaCJjrGrmlJcAAAD6G6ig (envelope-from ); Mon, 09 Mar 2026 13:08:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061692; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xoT4sJsTJCVUrSe47rt/c9mPM/gGJe7LdEyAE9/m3NE=; b=Oe2IdYwJwys1dZIuCtpKLrTk31fR/XHAndRrspRwlji7OhlzSZnjNRxUbnG3qP2l2TqtNV cUN9ra0HyPzFj5HrqsPvM7cjUsi+fG57m/sEgnTOBziMQO/TLKWWmZyvDxEQ4oIvmRX2OR 2mSWNUeHt1VIDqQHPKeLDbIelRbJWxU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061692; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xoT4sJsTJCVUrSe47rt/c9mPM/gGJe7LdEyAE9/m3NE=; b=PpdAZQK6R/5aNouWhCLoq0lgfH4BK8OKRO0ymmRyrfq5sdj+77cn02vCbjzeI+AS0vggoV 87gClQxF/uCFCGBA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773061692; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xoT4sJsTJCVUrSe47rt/c9mPM/gGJe7LdEyAE9/m3NE=; b=Oe2IdYwJwys1dZIuCtpKLrTk31fR/XHAndRrspRwlji7OhlzSZnjNRxUbnG3qP2l2TqtNV cUN9ra0HyPzFj5HrqsPvM7cjUsi+fG57m/sEgnTOBziMQO/TLKWWmZyvDxEQ4oIvmRX2OR 2mSWNUeHt1VIDqQHPKeLDbIelRbJWxU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773061692; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xoT4sJsTJCVUrSe47rt/c9mPM/gGJe7LdEyAE9/m3NE=; b=PpdAZQK6R/5aNouWhCLoq0lgfH4BK8OKRO0ymmRyrfq5sdj+77cn02vCbjzeI+AS0vggoV 87gClQxF/uCFCGBA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 22/22] colo: Reuse the return path from migration on primary and secondary side Date: Mon, 9 Mar 2026 10:07:27 -0300 Message-ID: <20260309130730.20526-23-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260309130730.20526-1-farosas@suse.de> References: <20260309130730.20526-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Spam-Score: -2.80 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a07:de40:b251:101:10:150:64:2; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1773061873714154100 Content-Type: text/plain; charset="utf-8" From: Lukas Straub Use the return-path capability with colo and reuse the opened return path file on both primary and secondary side. This fixes a crash in colo where migration_cancel() races with colo closing s->rp_state.from_dst_file. Signed-off-by: Lukas Straub Reviewed-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260302-colo_unit_test_multifd-v1= 1-21-d653fb3b1d80@web.de Signed-off-by: Fabiano Rosas --- docs/system/qemu-colo.rst | 4 ++-- migration/colo.c | 26 +++++++++----------------- migration/options.c | 10 +++++++++- tests/qtest/migration/colo-tests.c | 1 + tests/qtest/migration/framework.c | 13 +++++++++++++ 5 files changed, 34 insertions(+), 20 deletions(-) diff --git a/docs/system/qemu-colo.rst b/docs/system/qemu-colo.rst index a8f608b95e..d45586acd8 100644 --- a/docs/system/qemu-colo.rst +++ b/docs/system/qemu-colo.rst @@ -227,7 +227,7 @@ any IP's here, except for the ``$primary_ip`` variable:: **3.** On Secondary VM's QEMU monitor, issue command:: =20 {"execute":"qmp_capabilities"} - {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "return-path", "state": true }, {"capability": "x-colo", "= state": true } ] } } {"execute": "nbd-server-start", "arguments": {"addr": {"type": "inet",= "data": {"host": "0.0.0.0", "port": "9999"} } } } {"execute": "nbd-server-add", "arguments": {"device": "parent0", "writ= able": true } } =20 @@ -244,7 +244,7 @@ Note: {"execute":"qmp_capabilities"} {"execute": "blockdev-add", "arguments": {"driver": "nbd", "node-name"= : "nbd0", "server": {"type": "inet", "host": "127.0.0.2", "port": "9999"}, = "export": "parent0", "detect-zeroes": "on"} } {"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", = "node": "nbd0" } } - {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "return-path", "state": true }, {"capability": "x-colo", "= state": true } ] } } {"execute": "migrate", "arguments": {"uri": "tcp:127.0.0.2:9998" } } =20 Note: diff --git a/migration/colo.c b/migration/colo.c index dc47d03874..2d36f933cf 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -539,6 +539,8 @@ static void colo_process_checkpoint(MigrationState *s) Error *local_err =3D NULL; int ret; =20 + assert(s->rp_state.from_dst_file); + assert(!s->rp_state.rp_thread_created); if (get_colo_mode() !=3D COLO_MODE_PRIMARY) { error_report("COLO mode must be COLO_MODE_PRIMARY"); return; @@ -546,12 +548,6 @@ static void colo_process_checkpoint(MigrationState *s) =20 failover_init_state(); =20 - s->rp_state.from_dst_file =3D qemu_file_get_return_path(s->to_dst_file= ); - if (!s->rp_state.from_dst_file) { - error_report("Open QEMUFile from_dst_file failed"); - goto out; - } - packets_compare_notifier.notify =3D colo_compare_notify_checkpoint; colo_compare_register_notifier(&packets_compare_notifier); =20 @@ -636,16 +632,6 @@ out: colo_compare_unregister_notifier(&packets_compare_notifier); timer_free(s->colo_delay_timer); qemu_event_destroy(&s->colo_checkpoint_event); - - /* - * Must be called after failover BH is completed, - * Or the failover BH may shutdown the wrong fd that - * re-used by other threads after we release here. - */ - if (s->rp_state.from_dst_file) { - qemu_fclose(s->rp_state.from_dst_file); - s->rp_state.from_dst_file =3D NULL; - } } =20 void migrate_start_colo_process(MigrationState *s) @@ -838,6 +824,7 @@ static void *colo_process_incoming_thread(void *opaque) migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_COLO); =20 + assert(mis->to_src_file); if (get_colo_mode() !=3D COLO_MODE_SECONDARY) { error_report("COLO mode must be COLO_MODE_SECONDARY"); return NULL; @@ -854,7 +841,6 @@ static void *colo_process_incoming_thread(void *opaque) =20 failover_init_state(); =20 - mis->to_src_file =3D qemu_file_get_return_path(mis->from_src_file); /* * Note: the communication between Primary side and Secondary side * should be sequential, we set the fd to unblocked in migration incom= ing @@ -866,6 +852,12 @@ static void *colo_process_incoming_thread(void *opaque) goto out; } =20 + /* + * rp thread still running on primary side, shut it down to go into + * colo state. + */ + migrate_send_rp_shut(mis, 0); + colo_incoming_start_dirty_log(); =20 bioc =3D qio_channel_buffer_new(COLO_BUFFER_BASE_SIZE); diff --git a/migration/options.c b/migration/options.c index 1ffe85a2d8..f33b297929 100644 --- a/migration/options.c +++ b/migration/options.c @@ -575,7 +575,15 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps= , Error **errp) ERRP_GUARD(); MigrationIncomingState *mis =3D migration_incoming_get_current(); =20 -#ifndef CONFIG_REPLICATION +#ifdef CONFIG_REPLICATION + if (new_caps[MIGRATION_CAPABILITY_X_COLO]) { + if (!new_caps[MIGRATION_CAPABILITY_RETURN_PATH]) { + error_setg(errp, "Capability 'x-colo' requires capability " + "'return-path'"); + return false; + } + } +#else if (new_caps[MIGRATION_CAPABILITY_X_COLO]) { error_setg(errp, "QEMU compiled without replication module" " can't enable COLO"); diff --git a/tests/qtest/migration/colo-tests.c b/tests/qtest/migration/col= o-tests.c index bc20c92d16..ef880f5114 100644 --- a/tests/qtest/migration/colo-tests.c +++ b/tests/qtest/migration/colo-tests.c @@ -42,6 +42,7 @@ static int test_colo_common(MigrateCommon *args, * used in production. */ args->start.oob =3D true; + args->start.caps[MIGRATION_CAPABILITY_RETURN_PATH] =3D true; args->start.caps[MIGRATION_CAPABILITY_X_COLO] =3D true; =20 if (migrate_start(&from, &to, args->listen_uri, &args->start)) { diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/fram= ework.c index 2a3efeb807..0bfc241914 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -216,6 +216,19 @@ static void migrate_start_set_capabilities(QTestState = *from, QTestState *to, * MigrationCapability_lookup and MIGRATION_CAPABILITY_ constants * are from qapi-types-migration.h. */ + + /* + * Enable return path first, since other features depend on it. + */ + if (args->caps[MIGRATION_CAPABILITY_RETURN_PATH]) { + if (from) { + migrate_set_capability(from, "return-path", true); + } + if (to) { + migrate_set_capability(to, "return-path", true); + } + } + for (uint8_t i =3D 0; i < MIGRATION_CAPABILITY__MAX; i++) { if (!args->caps[i]) { continue; --=20 2.51.0