From nobody Sat Apr 11 23:02:58 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