From nobody Sun Apr 12 04:22:09 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=1771344965; cv=none; d=zohomail.com; s=zohoarc; b=WvmU+u2qIkualjU474im6e3w2H1/6i44/MCPYSE3MtMBvYgm/qjI9rkyK4I8L/svltzcI9JJjpdXrychnXEM4XI7KdF0l1nFPHeJDYqcZuh6YqCFsFiBL/Dk4X6WAIV49S0AhXuCi+hqru/fl06CpUHO6bQ+14dOeQtZocKEIvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344965; 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=I+Qmw7Yzt0MFJJHCsuKlVYNEl4JUC8kmhzOIYsIrLyU=; b=RlpYlNBYQLMHNINJr2wyhAH/gnWTUiNbdwPPokrFJQYW1i8S/N7PPg1x6mbIXwBHDXzSU+g5/4jjv9LIhtSeKChuujSPtxQz0d5yKt2lKNNDpu7JG9TAl3FkIKELYG4UmuJFvG244OiZ67/Ig73gqz/lJWeiZvk3yMQLkw5Nd64= 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 1771344965283829.4651245887176; Tue, 17 Feb 2026 08:16:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjD-00018J-Mm; Tue, 17 Feb 2026 11:15:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNj9-00016h-3V for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:07 -0500 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 1vsNj7-000366-4f for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:06 -0500 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 263413E71C; Tue, 17 Feb 2026 16:14: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 E0EAE3EA66; Tue, 17 Feb 2026 16:14:47 +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 OA/5KPeTlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344889; 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=I+Qmw7Yzt0MFJJHCsuKlVYNEl4JUC8kmhzOIYsIrLyU=; b=kE7AtzHWc+GRo7Vt6pNizFnwoX5iwA3NWp7uMKeCm6J3dyzofI45go2clkwpocfII8njUE V++/PalxkMl1wGwu4zT1Lk2pViEb081uTBk5B7hPM20tSnwHA5t+6L6jdcWwQb5fop1S8S SEqD8EX5cvVz789D4nhzhkJ+0ZGK1Jg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344889; 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=I+Qmw7Yzt0MFJJHCsuKlVYNEl4JUC8kmhzOIYsIrLyU=; b=ZyAwIgs14yxNTaF0ITXODqvSv3HxOZ15/8GfZQfqy7QI1McQnKsEvR/Ylfcz3brjBmuG1A pE9KZ6yUwyUMSECA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=kE7AtzHW; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ZyAwIgs1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344889; 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=I+Qmw7Yzt0MFJJHCsuKlVYNEl4JUC8kmhzOIYsIrLyU=; b=kE7AtzHWc+GRo7Vt6pNizFnwoX5iwA3NWp7uMKeCm6J3dyzofI45go2clkwpocfII8njUE V++/PalxkMl1wGwu4zT1Lk2pViEb081uTBk5B7hPM20tSnwHA5t+6L6jdcWwQb5fop1S8S SEqD8EX5cvVz789D4nhzhkJ+0ZGK1Jg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344889; 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=I+Qmw7Yzt0MFJJHCsuKlVYNEl4JUC8kmhzOIYsIrLyU=; b=ZyAwIgs14yxNTaF0ITXODqvSv3HxOZ15/8GfZQfqy7QI1McQnKsEvR/Ylfcz3brjBmuG1A pE9KZ6yUwyUMSECA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Stefan Hajnoczi Subject: [PULL 01/32] migration: Add a tracepoint for invoking migration notifiers Date: Tue, 17 Feb 2026 13:14:12 -0300 Message-ID: <20260217161443.12738-2-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; 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] X-Rspamd-Queue-Id: 263413E71C 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: 1771344967731158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu Reviewed-by: Fabiano Rosas Acked-by: Stefan Hajnoczi Signed-off-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260126213614.3815900-2-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 2 ++ migration/trace-events | 1 + 2 files changed, 3 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index b103a82fc0..341b9be80e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1528,6 +1528,8 @@ int migration_call_notifiers(MigrationEventType type,= Error **errp) GSList *elem, *next; int ret; =20 + trace_migration_call_notifiers(type); + e.type =3D type; =20 for (elem =3D migration_state_notifiers[mode]; elem; elem =3D next) { diff --git a/migration/trace-events b/migration/trace-events index 91d7506634..90629f828f 100644 --- a/migration/trace-events +++ b/migration/trace-events @@ -198,6 +198,7 @@ process_incoming_migration_co_end(int ret) "ret=3D%d" process_incoming_migration_co_postcopy_end_main(void) "" postcopy_preempt_enabled(bool value) "%d" migration_precopy_complete(void) "" +migration_call_notifiers(int type) "type=3D%d" =20 # migration-stats migration_transferred_bytes(uint64_t qemu_file, uint64_t multifd, uint64_t= rdma) "qemu_file %" PRIu64 " multifd %" PRIu64 " RDMA %" PRIu64 --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345106; cv=none; d=zohomail.com; s=zohoarc; b=QnyYDIFIi93CVIeJ/+w/AKl9xJMXNJXPKv68ZHJPw9UTTV4bbS1TR+HRbKar6t1yVu1Ou641sTTf95RZTrge1hoSJGBhcuMku1Az7YqHgIeXSEx8wN9V2/yryc6YJs9t0e2AqTBXqna2vfIBSlD2yYx/GsLRUAkueychoP5IsFE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345106; 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=xXsyLqugyk4Y2xMaV84xnYLMkiP6TjRpYpdyID4qv9w=; b=U+ao5wr4isVqj5cgY8u0vWaRIPDgNMAMv6BqQ2ypIW4z0Ch4T2LIwNFALb0EATZjRd8RzYQq2eS7vnx0Mr21OgXUADkW2yFvotHEJtCMEie2qFa3EHmzArq7Uh8a5wh/EX0M8J0lGTxeWAziy2uAyuELY0Wh3fJ8bkRkJLEc1xQ= 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 1771345106681522.9351110071136; Tue, 17 Feb 2026 08:18:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNj7-00015R-IE; Tue, 17 Feb 2026 11:15:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNj3-00011A-LK for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:02 -0500 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 1vsNiy-0002sp-MX for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:01 -0500 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 2E02F5BD14; Tue, 17 Feb 2026 16:14: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 8A1223EA66; Tue, 17 Feb 2026 16:14:49 +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 mLnbE/mTlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344891; 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=xXsyLqugyk4Y2xMaV84xnYLMkiP6TjRpYpdyID4qv9w=; b=OqGIzSWhki3Txve+PSaiLr/nvVrly957cackGumxbzQtEEjjmC9sYw+mdttf5VmjJ4X33R uBwsOyEHcUKKsfxU33SYMRsINOd3KRReb4OUA375hTdSy2qOxvaxhMTQmxOVf2gY/9c+nK eynglctgBFNRb2xOabGDHOvYu2IlQU4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344891; 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=xXsyLqugyk4Y2xMaV84xnYLMkiP6TjRpYpdyID4qv9w=; b=6C2BQrW82exN/tISkNsNbxP3e8Hj2IKZ2y776SKt0QDZl8PHIx6AsrsgbbVAmGWpD63QFE OExMX2rAJwURZVAg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344891; 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=xXsyLqugyk4Y2xMaV84xnYLMkiP6TjRpYpdyID4qv9w=; b=OqGIzSWhki3Txve+PSaiLr/nvVrly957cackGumxbzQtEEjjmC9sYw+mdttf5VmjJ4X33R uBwsOyEHcUKKsfxU33SYMRsINOd3KRReb4OUA375hTdSy2qOxvaxhMTQmxOVf2gY/9c+nK eynglctgBFNRb2xOabGDHOvYu2IlQU4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344891; 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=xXsyLqugyk4Y2xMaV84xnYLMkiP6TjRpYpdyID4qv9w=; b=6C2BQrW82exN/tISkNsNbxP3e8Hj2IKZ2y776SKt0QDZl8PHIx6AsrsgbbVAmGWpD63QFE OExMX2rAJwURZVAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Dr. David Alan Gilbert" Subject: [PULL 02/32] migration: Fix double notification of DONE/FAIL for postcopy Date: Tue, 17 Feb 2026 13:14:13 -0300 Message-ID: <20260217161443.12738-3-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; 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=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: 1771345108188158500 From: Peter Xu Migration notifiers will notify at any of three places: (1) SETUP phase, (2) migration completes, (3) migration fails. There's actually a special case for spice: one can refer to b82fc321bf ("Postcopy+spice: Pass spice migration data earlier"). It doesn't need another 4th event because in commit 9d9babf78d ("migration: MigrationEvent for notifiers") we merged it together with the DONE event. The merge makes some sense if we treat "switchover" of postcopy as "DONE", however that also means for postcopy we'll notify DONE twice.. The other one at the end of postcopy when migration_cleanup(). In reality, the current code base will also notify FAILED for postcopy twice. It's because an (maybe accidental) change in commit 4af667f87c ("migration: notifier error checking"). First of all, we still need that notification when switchover as stated in Dave's commit, however that's only needed for spice. To fix it, introduce POSTCOPY_START event to differenciate it from DONE. Use that instead in postcopy_start(). Then spice will need to capture this event too. Then we remove the extra FAILED notification in postcopy_start(). If one wonder if other DONE users should also monitor POSTCOPY_START event.. We have two more DONE users: - kvm_arm_gicv3_notifier - cpr_exec_notifier Both of them do not need a notification for POSTCOPY_START, but only when migration completed. Actually, both of them are used in CPR, which doesn't support postcopy. When at this, update the notifier transition graph in the comment, and move it from migration_add_notifier() to be closer to where the enum is defined. I didn't attach Fixes: because I am not aware of any real bug on such double reporting. I'm wildly guessing the 2nd notify might be silently ignored in many cases. However this is still worth fixing. Cc: Marc-Andr=C3=A9 Lureau Cc: Dr. David Alan Gilbert Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/qemu-devel/20260126213614.3815900-3-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- include/migration/misc.h | 16 ++++++++++++---- migration/migration.c | 3 +-- ui/spice-core.c | 3 ++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index e26d418a6e..1cd6cfd7f7 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -59,10 +59,22 @@ void migration_shutdown(void); bool migration_is_running(void); bool migration_thread_is_self(void); =20 +/* + * Notifiers may receive events in any of the following orders: + * + * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] + * -> MIG_EVENT_PRECOPY_DONE + * + * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] + * -> MIG_EVENT_PRECOPY_FAILED + * + * - MIG_EVENT_PRECOPY_FAILED + */ typedef enum MigrationEventType { MIG_EVENT_PRECOPY_SETUP, MIG_EVENT_PRECOPY_DONE, MIG_EVENT_PRECOPY_FAILED, + MIG_EVENT_POSTCOPY_START, MIG_EVENT_MAX } MigrationEventType; =20 @@ -81,10 +93,6 @@ typedef int (*MigrationNotifyFunc)(NotifierWithReturn *n= otify, /* * Register the notifier @notify to be called when a migration event occurs * for MIG_MODE_NORMAL, as specified by the MigrationEvent passed to @func. - * Notifiers may receive events in any of the following orders: - * - MIG_EVENT_PRECOPY_SETUP -> MIG_EVENT_PRECOPY_DONE - * - MIG_EVENT_PRECOPY_SETUP -> MIG_EVENT_PRECOPY_FAILED - * - MIG_EVENT_PRECOPY_FAILED */ void migration_add_notifier(NotifierWithReturn *notify, MigrationNotifyFunc func); diff --git a/migration/migration.c b/migration/migration.c index 341b9be80e..bd24006c1a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2591,7 +2591,7 @@ static int postcopy_start(MigrationState *ms, Error *= *errp) * at the transition to postcopy and after the device state; in partic= ular * spice needs to trigger a transition now */ - migration_call_notifiers(MIG_EVENT_PRECOPY_DONE, NULL); + migration_call_notifiers(MIG_EVENT_POSTCOPY_START, NULL); =20 migration_downtime_end(ms); =20 @@ -2640,7 +2640,6 @@ fail: migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED); } migration_block_activate(NULL); - migration_call_notifiers(MIG_EVENT_PRECOPY_FAILED, NULL); bql_unlock(); return -1; } diff --git a/ui/spice-core.c b/ui/spice-core.c index 8a6050f4ae..ce3c2954e3 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -585,7 +585,8 @@ static int migration_state_notifier(NotifierWithReturn = *notifier, =20 if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { spice_server_migrate_start(spice_server); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + } else if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE || + e->type =3D=3D MIG_EVENT_POSTCOPY_START) { spice_server_migrate_end(spice_server, true); spice_have_target_host =3D false; } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344964; cv=none; d=zohomail.com; s=zohoarc; b=J+G3HlrnFRMPUhUVeQ0BacyLmZb7tfP7Y7boTwnIICj2wC+WoP9aJm7KSY7NYZL+qkJKrH1N0Zx+yT3/rd+DFMdCo3P2WwVzKNKwdsZh2ig/6UydQ9B3a/rfYeTLrdRie45X2CtuXhNTH2Vjmh8/5qFRmPBWYQsVLc1dmEmjAW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344964; 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=lXS3qPLaaXZTCH90dpwD2LMixcjitYHHrgCtwvXeX1M=; b=mHjxoT61Lv3Dm0LmIgTyS1fmKPw3tiorHgAgpQOXCKveafDM0MqDAJbmLc5F4RAH8E7E58Gs2rKEjNtiPrmfexcZML8BT3/vI0UEGwUDpp2rfXoR+iZNqJef+gZe/uYpGDbFm8/hbPMBoVM2MHwI4wy9R3ual+gq2GfXsSiX0/0= 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 17713449649243.328635503336841; Tue, 17 Feb 2026 08:16:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjB-00017q-5C; Tue, 17 Feb 2026 11:15:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNj9-00017Y-GR for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:07 -0500 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 1vsNj7-000369-LV for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:07 -0500 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 487285BD25; Tue, 17 Feb 2026 16:14: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 917053EA66; Tue, 17 Feb 2026 16:14: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 SC6cFfuTlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344893; 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=lXS3qPLaaXZTCH90dpwD2LMixcjitYHHrgCtwvXeX1M=; b=slWUp8qc2/LdKG/VYXlMo4E1TuJ0H1/zl+EBX4ezaZW+AmcO6DVLiFF8sICMXJWxxN0hLn Bbt4e318zYru0uahbwnCiX4mg3HYV9E/SNA8dCMpyZvujQzgkkJXmoou2qYq0LNbGZ2zS2 ZS8Wy6LRZ8456tOOb05KxFSG8gr7Or0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344893; 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=lXS3qPLaaXZTCH90dpwD2LMixcjitYHHrgCtwvXeX1M=; b=7DKaFzuqEkS1fFvWd/Y0KHrx3b4njF2gCXBjAP5Jmf6bZGLHBXrVziOLQs3qr1RBy3/QVk JgMUdHYbIqIIJdDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=slWUp8qc; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=7DKaFzuq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344893; 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=lXS3qPLaaXZTCH90dpwD2LMixcjitYHHrgCtwvXeX1M=; b=slWUp8qc2/LdKG/VYXlMo4E1TuJ0H1/zl+EBX4ezaZW+AmcO6DVLiFF8sICMXJWxxN0hLn Bbt4e318zYru0uahbwnCiX4mg3HYV9E/SNA8dCMpyZvujQzgkkJXmoou2qYq0LNbGZ2zS2 ZS8Wy6LRZ8456tOOb05KxFSG8gr7Or0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344893; 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=lXS3qPLaaXZTCH90dpwD2LMixcjitYHHrgCtwvXeX1M=; b=7DKaFzuqEkS1fFvWd/Y0KHrx3b4njF2gCXBjAP5Jmf6bZGLHBXrVziOLQs3qr1RBy3/QVk JgMUdHYbIqIIJdDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Hajnoczi Subject: [PULL 03/32] migration: Notify migration FAILED before starting VM Date: Tue, 17 Feb 2026 13:14:14 -0300 Message-ID: <20260217161443.12738-4-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_SOME(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_TWO(0.00)[2]; 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]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,suse.de:email]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Spam-Score: -3.51 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 487285BD25 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771344965961158500 From: Peter Xu Devices may opt-in migration FAILED notifiers to be invoked when migration fails. Currently, the notifications happen in migration_cleanup(). It is normally fine, but maybe not ideal if there's dependency of the fallback v.s. VM starts. This patch moves the FAILED notification earlier, so that if the failure happened during switchover, it'll notify before VM restart. After walking over all existing FAILED notifier users, I got the conclusion that this should also be a cleaner approach at least from design POV. We have these notifier users, where the first two do not need to trap FAILED: |----------------------------+-------------------------------------+-------= --------------| | device | handler | events= needed | |----------------------------+-------------------------------------+-------= --------------| | gicv3 | kvm_arm_gicv3_notifier | DONE = | | vfio_iommufd / vfio_legacy | vfio_cpr_reboot_notifier | SETUP = | | cpr-exec | cpr_exec_notifier | FAILED= , DONE | | virtio-net | virtio_net_migration_state_notifier | SETUP,= FAILED | | vfio | vfio_migration_state_notifier | FAILED= | | vdpa | vdpa_net_migration_state_notifier | SETUP,= FAILED | | spice [*] | migration_state_notifier | SETUP,= FAILED, DONE | |----------------------------+-------------------------------------+-------= --------------| For cpr-exec, it tries to cleanup some cpr-exec specific fd or env variables. This should be fine either way, as long as before migration_cleanup(). For virtio-net, we need to re-plug the primary device back to guest in the failover mode. Likely benign. VFIO needs to re-start the device if FAILED. IIUC it should do it before vm_start(), if the VFIO device can be put into a STOPed state due to migration, we should logically make it running again before vCPUs run. VDPA will disable SVQ when migration is FAILED. Likely benign too, but looks better if we can do it before resuming vCPUs. For spice, we should rely on "spice_server_migrate_end(false)" to retake the ownership. Benign, but looks more reasonable if the spice client does it before VM runs again. Note that this change may introduce slightly more downtime, if the migration failed exactly at the switchover phase. But that's very rare, and even if it happens, none of above expects a long delay, but a short one, likely will be buried in the total downtime even if failed. Cc: C=C3=A9dric Le Goater Cc: Marc-Andr=C3=A9 Lureau Acked-by: Stefan Hajnoczi Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260126213614.3815900-4-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index bd24006c1a..8d1c294b47 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1283,7 +1283,6 @@ static void migration_cleanup_json_writer(MigrationSt= ate *s) =20 static void migration_cleanup(MigrationState *s) { - MigrationEventType type; QEMUFile *tmp =3D NULL; =20 trace_migration_cleanup(); @@ -1333,9 +1332,14 @@ static void migration_cleanup(MigrationState *s) MIGRATION_STATUS_CANCELLED); } =20 - type =3D migration_has_failed(s) ? MIG_EVENT_PRECOPY_FAILED : - MIG_EVENT_PRECOPY_DONE; - migration_call_notifiers(type, NULL); + /* + * FAILED notification should have already happened. Notify DONE if + * migration completed successfully. + */ + if (!migration_has_failed(s)) { + migration_call_notifiers(MIG_EVENT_PRECOPY_DONE, NULL); + } + yank_unregister_instance(MIGRATION_YANK_INSTANCE); } =20 @@ -3323,6 +3327,13 @@ static void migration_iteration_finish(MigrationStat= e *s) error_free(local_err); break; } + + /* + * Notify FAILED before starting VM, so that devices can invoke + * necessary fallbacks before vCPUs run again. + */ + migration_call_notifiers(MIG_EVENT_PRECOPY_FAILED, NULL); + if (runstate_is_live(s->vm_old_state)) { if (!runstate_check(RUN_STATE_SHUTDOWN)) { vm_start(); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344968; cv=none; d=zohomail.com; s=zohoarc; b=eRHkIfgyQvJ8tAHa0HqZrdsOzorXlHy++ibJiaEuTp9LkaG1OuxPVdFX5wTJHDM2OLaRWIITU5jNo5kfvQDJF53JECUA8OKsELqdLgExr/O2XVoe7Duuo+jHR3R+UXxnP74+vUkyxB4dpp4rWRYVH+FqImApzzugxgnP2f3aGAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344968; 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=llqUopGojAmUi9i9XISavXREc2U/9uYAT7sNS/4AGlw=; b=aWHJ3Uo6+aJu6WM2f21AzdJZeL9B4cYGM3FpigVqOiY98daWDV4G3v3RVGOk37kHeDpiYSAakify0uXhor2LifrUMchLBBOA3aZvgebs9AS3JUBOzWlCcTqaHTnvyrAHOa6TJEWKsViK1Gm3lxTZkC4g3ZRHwu6LjOXaTFmbDwg= 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 1771344968449741.7945495206294; Tue, 17 Feb 2026 08:16:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjF-000198-Nd; Tue, 17 Feb 2026 11:15:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjF-00018x-42 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:13 -0500 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 1vsNjD-00037H-Hv for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:12 -0500 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 E5A875BCF6; Tue, 17 Feb 2026 16:14: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 ABAA83EA66; Tue, 17 Feb 2026 16:14: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 0KD6G/2TlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344894; 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=llqUopGojAmUi9i9XISavXREc2U/9uYAT7sNS/4AGlw=; b=WPYJ75kfpkGTaFGlTcgeQAhkWnoBqzyeuzy21DplYJfwLybpLzOiKyuXhphmOc9OsCRvJz mQ1RD8LW9TLbf7Wqb3yaidn0xb+FfPdzH/OzLhajQDBKt2I/9625eNfYGneYmkXR7B3rmK e3xLRtMnGWgauew/8rqoqcnzZLFddtc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344894; 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=llqUopGojAmUi9i9XISavXREc2U/9uYAT7sNS/4AGlw=; b=GFY+vVOeCg0LyR9bzHqPxH1P1WLRHyWOZqmLbznsKd0lrFVV+cmVzkrfGAmwfkz2AW2c0t J36UY6rqu4678mDw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344894; 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=llqUopGojAmUi9i9XISavXREc2U/9uYAT7sNS/4AGlw=; b=WPYJ75kfpkGTaFGlTcgeQAhkWnoBqzyeuzy21DplYJfwLybpLzOiKyuXhphmOc9OsCRvJz mQ1RD8LW9TLbf7Wqb3yaidn0xb+FfPdzH/OzLhajQDBKt2I/9625eNfYGneYmkXR7B3rmK e3xLRtMnGWgauew/8rqoqcnzZLFddtc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344894; 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=llqUopGojAmUi9i9XISavXREc2U/9uYAT7sNS/4AGlw=; b=GFY+vVOeCg0LyR9bzHqPxH1P1WLRHyWOZqmLbznsKd0lrFVV+cmVzkrfGAmwfkz2AW2c0t J36UY6rqu4678mDw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Stefan Hajnoczi Subject: [PULL 04/32] migration: Drop explicit block activation in postcopy fail path Date: Tue, 17 Feb 2026 13:14:15 -0300 Message-ID: <20260217161443.12738-5-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771344971699154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Postcopy (in failure path) should share with precopy on disk reactivations. Explicit activiation should used to be fine even if called twice, but after 26f65c01ed ("migration: Do not try to start VM if disk activation fails") we may want to avoid it and always capture failure when reactivation happens (even if we do not expect the failure to happen). Remove this redundant call. Reviewed-by: Fabiano Rosas Acked-by: Stefan Hajnoczi Signed-off-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260126213614.3815900-5-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 8d1c294b47..a5b0561cbe 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2643,7 +2643,6 @@ fail: if (ms->state !=3D MIGRATION_STATUS_CANCELLING) { migrate_set_state(&ms->state, ms->state, MIGRATION_STATUS_FAILED); } - migration_block_activate(NULL); bql_unlock(); return -1; } --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345106; cv=none; d=zohomail.com; s=zohoarc; b=QuoRahRzY/Ez9bIxQEUZKIWLHNQMqnoFknBDH50D9u1yLV5XITQuN+htHYSDuJUK1WMocjEO6vwb0sDBXyIBzLdK7doyQhrCubRI+dXJ3apMAZnRKQ7/tABYWzETFlv6vrXF6RaxXxneapgtoJKVyLQP4OQ9vMavZdVX9OOllZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345106; 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=dMoJHi/jUafcNoVo1u4cOIrAwRUSJp2lE9e5dows5eA=; b=L+wIFVmdQLaWzow1XFnpFF3Y4Pr8GesmVWRgtii3zme5xpQxnO0R04p/7MjMSymHd4yZwmoMM5DRmIoZxKjBX6q5ofMBaMxDoa7Mn6WmbHUi4jY9BmGBiuikktNon+JVdylwhxkgY0k8DG/UDhfs0BRQQuNd3xvfQuJys2G+Qo4= 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 1771345106569946.3869869812986; Tue, 17 Feb 2026 08:18:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjN-0001A7-AW; Tue, 17 Feb 2026 11:15:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjL-00019m-9z for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:19 -0500 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 1vsNjI-00038C-UL for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:19 -0500 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 8D9F65BD26; Tue, 17 Feb 2026 16:14: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 54ADE3EA66; Tue, 17 Feb 2026 16:14:55 +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 0PzCBv+TlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344896; 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=dMoJHi/jUafcNoVo1u4cOIrAwRUSJp2lE9e5dows5eA=; b=d+JvVqyAxEkZHkEy15grL0wTzz4ga/QHc9KVr5Fb05KhJHuU8IuVbYYCfD1f9pM0DuGqfT jdbS2uju84bpuLTiFG+2I6QW3XV9+eL6nd0w1nrEtFHBGTK25uFY9OqTIio+8kl2gp2aeh G+a1vggoQbfJY64PgvnThZQns25gz0M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344896; 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=dMoJHi/jUafcNoVo1u4cOIrAwRUSJp2lE9e5dows5eA=; b=aNTFdaTEaW20A3DE06PiYTTiSgf72pnlwkjc+iFli6hgns3Ax+dOoSeA6BJVnIuKJsZO9V 4+18geW2zD3l/fAA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=d+JvVqyA; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=aNTFdaTE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344896; 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=dMoJHi/jUafcNoVo1u4cOIrAwRUSJp2lE9e5dows5eA=; b=d+JvVqyAxEkZHkEy15grL0wTzz4ga/QHc9KVr5Fb05KhJHuU8IuVbYYCfD1f9pM0DuGqfT jdbS2uju84bpuLTiFG+2I6QW3XV9+eL6nd0w1nrEtFHBGTK25uFY9OqTIio+8kl2gp2aeh G+a1vggoQbfJY64PgvnThZQns25gz0M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344896; 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=dMoJHi/jUafcNoVo1u4cOIrAwRUSJp2lE9e5dows5eA=; b=aNTFdaTEaW20A3DE06PiYTTiSgf72pnlwkjc+iFli6hgns3Ax+dOoSeA6BJVnIuKJsZO9V 4+18geW2zD3l/fAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Stefan Hajnoczi Subject: [PULL 05/32] migration: Rename MIG_EVENT_PRECOPY_* to MIG_EVENT_* Date: Tue, 17 Feb 2026 13:14:16 -0300 Message-ID: <20260217161443.12738-6-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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%]; 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)[]; 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]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; 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-Queue-Id: 8D9F65BD26 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: 1771345108258158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu All three events are shared between precopy and postcopy, rather than precopy specific. For example, both precopy and postcopy will go through a SETUP process. Meanwhile, both FAILED and DONE notifiers will be notified for either precopy or postcopy on completions / failures. Rename them to make them match what they do, and shorter. Reviewed-by: Fabiano Rosas Acked-by: Stefan Hajnoczi Signed-off-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260126213614.3815900-6-peterx@re= dhat.com [fixed-up entry in scsi-disk.c that got merged first] Signed-off-by: Fabiano Rosas --- hw/intc/arm_gicv3_kvm.c | 2 +- hw/net/virtio-net.c | 4 ++-- hw/scsi/scsi-disk.c | 4 ++-- hw/vfio/cpr-legacy.c | 2 +- hw/vfio/cpr.c | 8 ++++---- hw/vfio/migration.c | 4 ++-- include/migration/misc.h | 18 +++++++----------- migration/cpr-exec.c | 6 +++--- migration/migration.c | 8 ++++---- net/vhost-vdpa.c | 4 ++-- ui/spice-core.c | 6 +++--- 11 files changed, 31 insertions(+), 35 deletions(-) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 6f311e37ef..fddeefa26f 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -774,7 +774,7 @@ static void vm_change_state_handler(void *opaque, bool = running, static int kvm_arm_gicv3_notifier(NotifierWithReturn *notifier, MigrationEvent *e, Error **errp) { - if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + if (e->type =3D=3D MIG_EVENT_DONE) { GICv3State *s =3D container_of(notifier, GICv3State, cpr_notifier); return kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES, diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 512a7c02c9..cc89619a43 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3789,7 +3789,7 @@ static void virtio_net_handle_migration_primary(VirtI= ONet *n, MigrationEvent *e) =20 should_be_hidden =3D qatomic_read(&n->failover_primary_hidden); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP && !should_be_hidden) { + if (e->type =3D=3D MIG_EVENT_SETUP && !should_be_hidden) { if (failover_unplug_primary(n, dev)) { vmstate_unregister(VMSTATE_IF(dev), qdev_get_vmsd(dev), dev); qapi_event_send_unplug_primary(dev->id); @@ -3797,7 +3797,7 @@ static void virtio_net_handle_migration_primary(VirtI= ONet *n, MigrationEvent *e) } else { warn_report("couldn't unplug primary device"); } - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { /* We already unplugged the device let's plug it back */ if (!failover_replug_primary(n, dev, &err)) { if (err) { diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 877ad21579..2f400f5b77 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2747,14 +2747,14 @@ static SCSIRequest *scsi_new_request(SCSIDevice *d,= uint32_t tag, uint32_t lun, static int scsi_block_migration_notifier(NotifierWithReturn *notifier, MigrationEvent *e, Error **errp) { - if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + if (e->type =3D=3D MIG_EVENT_FAILED) { SCSIDiskState *s =3D container_of(notifier, SCSIDiskState, migration_notifier); SCSIDevice *d =3D &s->qdev; Error *local_err =3D NULL; =20 if (!scsi_generic_pr_state_preempt(d, &local_err)) { - /* MIG_EVENT_PRECOPY_FAILED cannot fail, so just warn */ + /* MIG_EVENT_FAILED cannot fail, so just warn */ error_prepend(&local_err, "scsi-block migration rollback: "); warn_report_err(local_err); } diff --git a/hw/vfio/cpr-legacy.c b/hw/vfio/cpr-legacy.c index 7c03ddb961..033a546c30 100644 --- a/hw/vfio/cpr-legacy.c +++ b/hw/vfio/cpr-legacy.c @@ -137,7 +137,7 @@ static int vfio_cpr_fail_notifier(NotifierWithReturn *n= otifier, container_of(notifier, VFIOLegacyContainer, cpr.transfer_notifier); VFIOContainer *bcontainer =3D VFIO_IOMMU(container); =20 - if (e->type !=3D MIG_EVENT_PRECOPY_FAILED) { + if (e->type !=3D MIG_EVENT_FAILED) { return 0; } =20 diff --git a/hw/vfio/cpr.c b/hw/vfio/cpr.c index 998230d271..ffa4f8e099 100644 --- a/hw/vfio/cpr.c +++ b/hw/vfio/cpr.c @@ -18,7 +18,7 @@ int vfio_cpr_reboot_notifier(NotifierWithReturn *notifier, MigrationEvent *e, Error **errp) { - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP && + if (e->type =3D=3D MIG_EVENT_SETUP && !runstate_check(RUN_STATE_SUSPENDED) && !vm_get_suspended()) { =20 error_setg(errp, @@ -186,7 +186,7 @@ static int vfio_cpr_kvm_close_notifier(NotifierWithRetu= rn *notifier, MigrationEvent *e, Error **errp) { - if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + if (e->type =3D=3D MIG_EVENT_DONE) { vfio_kvm_device_close(); } return 0; @@ -272,9 +272,9 @@ static int vfio_cpr_pci_notifier(NotifierWithReturn *no= tifier, VFIOPCIDevice *vdev =3D container_of(notifier, VFIOPCIDevice, cpr.transfer_notifier); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { + if (e->type =3D=3D MIG_EVENT_SETUP) { return vfio_cpr_set_msi_virq(vdev, errp, false); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { return vfio_cpr_set_msi_virq(vdev, errp, true); } return 0; diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index b4695030c7..adacfe36c6 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -917,10 +917,10 @@ static int vfio_migration_state_notifier(NotifierWith= Return *notifier, =20 trace_vfio_migration_state_notifier(vbasedev->name, e->type); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + if (e->type =3D=3D MIG_EVENT_FAILED) { /* * MigrationNotifyFunc may not return an error code and an Error - * object for MIG_EVENT_PRECOPY_FAILED. Hence, report the error + * object for MIG_EVENT_FAILED. Hence, report the error * locally and ignore the errp argument. */ ret =3D vfio_migration_set_state_or_reset(vbasedev, diff --git a/include/migration/misc.h b/include/migration/misc.h index 1cd6cfd7f7..3159a5e53c 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -62,19 +62,15 @@ bool migration_thread_is_self(void); /* * Notifiers may receive events in any of the following orders: * - * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] - * -> MIG_EVENT_PRECOPY_DONE - * - * - MIG_EVENT_PRECOPY_SETUP [-> MIG_EVENT_POSTCOPY_START] - * -> MIG_EVENT_PRECOPY_FAILED - * - * - MIG_EVENT_PRECOPY_FAILED + * - MIG_EVENT_SETUP [-> MIG_EVENT_POSTCOPY_START] -> MIG_EVENT_DONE + * - MIG_EVENT_SETUP [-> MIG_EVENT_POSTCOPY_START] -> MIG_EVENT_FAILED + * - MIG_EVENT_FAILED */ typedef enum MigrationEventType { - MIG_EVENT_PRECOPY_SETUP, - MIG_EVENT_PRECOPY_DONE, - MIG_EVENT_PRECOPY_FAILED, + MIG_EVENT_SETUP, MIG_EVENT_POSTCOPY_START, + MIG_EVENT_DONE, + MIG_EVENT_FAILED, MIG_EVENT_MAX } MigrationEventType; =20 @@ -84,7 +80,7 @@ typedef struct MigrationEvent { =20 /* * A MigrationNotifyFunc may return an error code and an Error object, - * but only when @e->type is MIG_EVENT_PRECOPY_SETUP. The code is an int + * but only when @e->type is MIG_EVENT_SETUP. The code is an int * to allow for different failure modes and recovery actions. */ typedef int (*MigrationNotifyFunc)(NotifierWithReturn *notify, diff --git a/migration/cpr-exec.c b/migration/cpr-exec.c index e315a30f92..daa50916d2 100644 --- a/migration/cpr-exec.c +++ b/migration/cpr-exec.c @@ -164,7 +164,7 @@ static void cpr_exec_cb(void *opaque) err =3D NULL; =20 /* Note, we can go from state COMPLETED to FAILED */ - migration_call_notifiers(MIG_EVENT_PRECOPY_FAILED, NULL); + migration_call_notifiers(MIG_EVENT_FAILED, NULL); =20 if (!migration_block_activate(&err)) { /* error was already reported */ @@ -182,12 +182,12 @@ static int cpr_exec_notifier(NotifierWithReturn *noti= fier, MigrationEvent *e, { MigrationState *s =3D migrate_get_current(); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE) { + if (e->type =3D=3D MIG_EVENT_DONE) { QEMUBH *cpr_exec_bh =3D qemu_bh_new(cpr_exec_cb, NULL); assert(s->state =3D=3D MIGRATION_STATUS_COMPLETED); qemu_bh_schedule(cpr_exec_bh); qemu_notify_event(); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { cpr_exec_unpersist_state(); } return 0; diff --git a/migration/migration.c b/migration/migration.c index a5b0561cbe..7ab0294d22 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1337,7 +1337,7 @@ static void migration_cleanup(MigrationState *s) * migration completed successfully. */ if (!migration_has_failed(s)) { - migration_call_notifiers(MIG_EVENT_PRECOPY_DONE, NULL); + migration_call_notifiers(MIG_EVENT_DONE, NULL); } =20 yank_unregister_instance(MIGRATION_YANK_INSTANCE); @@ -1541,7 +1541,7 @@ int migration_call_notifiers(MigrationEventType type,= Error **errp) notifier =3D (NotifierWithReturn *)elem->data; ret =3D notifier->notify(notifier, &e, errp); if (ret) { - assert(type =3D=3D MIG_EVENT_PRECOPY_SETUP); + assert(type =3D=3D MIG_EVENT_SETUP); return ret; } } @@ -3331,7 +3331,7 @@ static void migration_iteration_finish(MigrationState= *s) * Notify FAILED before starting VM, so that devices can invoke * necessary fallbacks before vCPUs run again. */ - migration_call_notifiers(MIG_EVENT_PRECOPY_FAILED, NULL); + migration_call_notifiers(MIG_EVENT_FAILED, NULL); =20 if (runstate_is_live(s->vm_old_state)) { if (!runstate_check(RUN_STATE_SHUTDOWN)) { @@ -3769,7 +3769,7 @@ void migration_start_outgoing(MigrationState *s) rate_limit =3D migrate_max_bandwidth(); =20 /* Notify before starting migration thread */ - if (migration_call_notifiers(MIG_EVENT_PRECOPY_SETUP, &local_err))= { + if (migration_call_notifiers(MIG_EVENT_SETUP, &local_err)) { goto fail; } } diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 74d26a9497..f4b1f0e9e0 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -378,9 +378,9 @@ static int vdpa_net_migration_state_notifier(NotifierWi= thReturn *notifier, { VhostVDPAState *s =3D container_of(notifier, VhostVDPAState, migration= _state); =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { + if (e->type =3D=3D MIG_EVENT_SETUP) { vhost_vdpa_net_log_global_enable(s, true); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { vhost_vdpa_net_log_global_enable(s, false); } return 0; diff --git a/ui/spice-core.c b/ui/spice-core.c index ce3c2954e3..ee13ecc4a5 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -583,13 +583,13 @@ static int migration_state_notifier(NotifierWithRetur= n *notifier, return 0; } =20 - if (e->type =3D=3D MIG_EVENT_PRECOPY_SETUP) { + if (e->type =3D=3D MIG_EVENT_SETUP) { spice_server_migrate_start(spice_server); - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_DONE || + } else if (e->type =3D=3D MIG_EVENT_DONE || e->type =3D=3D MIG_EVENT_POSTCOPY_START) { spice_server_migrate_end(spice_server, true); spice_have_target_host =3D false; - } else if (e->type =3D=3D MIG_EVENT_PRECOPY_FAILED) { + } else if (e->type =3D=3D MIG_EVENT_FAILED) { spice_server_migrate_end(spice_server, false); spice_have_target_host =3D false; } --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344972; cv=none; d=zohomail.com; s=zohoarc; b=h3E+zdTHhzO+U/K4IMXup6X+MbnGHkyioAulDewcBNmk2VxNhq1EA8rahDEzhjx4BJ0SV177Np9Ur8i604Ct9UBZIxKrIY7RyiDQNj9Sbn1nVmY7TWRiY9+d+KplnngdVaE2ut+KA0GWEJzLbM3vX5YVJxg6xr6mvW5SVc9bJGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344972; 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=/FTa9nDOo0CQKYv3Kw0PjHMAuXiEYgAuNBcR2Xn4edk=; b=bktnYBqD5Nbizb9tuE5R5aihVdA1nTebvxRN8qo9CewNDoea4JnH/t5oHg9Hg0MQGtzYTfJh7MbBq83F7nSqFAkiOly5tfP5KS1aOcazIpl2Crw0F/RXMD0cf64qaAGX02wF2uZDQmd8ha3D2k98KJ97NcvPIj3geal5Z898gWI= 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 1771344972612981.3252137048869; Tue, 17 Feb 2026 08:16:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjF-00018y-7A; Tue, 17 Feb 2026 11:15:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjD-00018N-NI for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:11 -0500 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 1vsNjC-000379-4P for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:11 -0500 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 F16233E720; Tue, 17 Feb 2026 16:14: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 F18633EA66; Tue, 17 Feb 2026 16:14: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 iGUILQCUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344898; 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=/FTa9nDOo0CQKYv3Kw0PjHMAuXiEYgAuNBcR2Xn4edk=; b=U+pau7cKJSCu7C+fY84Rzot5bg9jXPBwguMdbdutUxfGypLw0AWwvyt5X53C5QxjjBSp8d +rjTFJQsiKPp19war52jlzEbbNzF6QbXH656jET5DeL76tyKioH0nP5tZIegYRqbDkKyOu H8ZUrOU5BNksI02LK3Ja1JKS1KER6Ao= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344898; 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=/FTa9nDOo0CQKYv3Kw0PjHMAuXiEYgAuNBcR2Xn4edk=; b=w6hgHXFSqSw7rLsdbWRdmxxMQa7js/9zaFA3UYRE7KP90Z6Ek9QnO9VZvMch/Ee5dHIyA9 wxPwbNrL6OZsqmAQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=vUt9K8Dr; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=azxbTjW8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344897; 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=/FTa9nDOo0CQKYv3Kw0PjHMAuXiEYgAuNBcR2Xn4edk=; b=vUt9K8Drwiu5c7p8h+F0X4EXSfR9C0JAUexBHsTtvov7fovksSyDQLh30zbmBNSbTfFWMx 1uGsmHxxQhJaAK8DEtZ9BG+u3G1o49Xg7JSnDtailqFZj42lglhI8koxZIsONgboi9Yrse m0532juNZH2Cks7YkfxpRmRV1FxX+dc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344897; 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=/FTa9nDOo0CQKYv3Kw0PjHMAuXiEYgAuNBcR2Xn4edk=; b=azxbTjW8O0xS9LXqm7c10TcCwox7P8f5FuptfWIfVIcXUaEG/gx51BDc5UGEHPLHrmARpc +sh0eNuPQWowEcCw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu Subject: [PULL 06/32] migration: Update comments mentioning qmp_migrate_finish Date: Tue, 17 Feb 2026 13:14:17 -0300 Message-ID: <20260217161443.12738-7-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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%]; 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)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; URIBL_BLOCKED(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Queue-Id: F16233E720 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) (identity @suse.de) X-ZM-MESSAGEID: 1771344973515158500 Content-Type: text/plain; charset="utf-8" The qmp_migrate_finish function was recently removed in commit 2379a04e60 ("migration: Remove qmp_migrate_finish"), update comments that mention it. Reviewed-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260202124112.30684-1-farosas@sus= e.de Signed-off-by: Fabiano Rosas --- migration/migration.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 7ab0294d22..850150a261 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1473,8 +1473,8 @@ void migration_cancel(void) } =20 /* - * If qmp_migrate_finish has not been called, then there is no path th= at - * will complete the cancellation. Do it now. + * If migration_connect_outgoing has not been called, then there + * is no path that will complete the cancellation. Do it now. */ if (setup && !s->to_dst_file) { migrate_set_state(&s->state, MIGRATION_STATUS_CANCELLING, @@ -2057,11 +2057,12 @@ void qmp_migrate(const char *uri, bool has_channels, * For cpr-transfer, the target may not be listening yet on the migrat= ion * channel, because first it must finish cpr_load_state. The target t= ells * us it is listening by closing the cpr-state socket. Wait for that = HUP - * event before connecting in qmp_migrate_finish. + * event before connecting in migration_connect_outgoing. * * The HUP could occur because the target fails while reading CPR stat= e, * in which case the target will not listen for the incoming migration - * connection, so qmp_migrate_finish will fail to connect, and then re= cover. + * connection, so migration_connect_outgoing will fail to connect, + * and then recover. */ if (migrate_mode() =3D=3D MIG_MODE_CPR_TRANSFER) { cpr_transfer_add_hup_watch(s, migration_connect_outgoing_cb, --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345149; cv=none; d=zohomail.com; s=zohoarc; b=eyCBE/HhZrx9PcWMnuRzOdwbkBoK7FICdMAW/J/D13XfkK9QBIwMUiwvC6C3jnqk7NE/pJTe/7JKpKbLlRj0+7raFQFnHPZhP3bm4q9IwTEjIMr02gq3t9VtA362DGulrL8Y0NUa1OrUb9QPsoSssPMNxGofhIOZnls+tzc2I4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345149; 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=Tt6xtbA2n5hWWtncehHc/xG3dXOV3D/lx4LNtYgrSGg=; b=d5inkcv0ZNI3pjMky0AYxaFlKDoXAoxUvli+dtmzUZvqeY50wbRNAdRA9Ov3kqzpQUQ3uDd5BvP2bYI9QKMmHYwwUYf/7IFnkTYRN0Z9GGQpdQ+y/DQJQKUrT+OptPN4unPYOgD6WAQRuGFUNUyy1x2Z0Yacf+N1PWG2LJ7UtuM= 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 1771345149403286.5552170765242; Tue, 17 Feb 2026 08:19:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjL-00019i-7Q; Tue, 17 Feb 2026 11:15:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjJ-00019Y-7g for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:17 -0500 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 1vsNjH-00037s-CD for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:16 -0500 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 9A4A83E725; Tue, 17 Feb 2026 16:14:59 +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 615E13EA66; Tue, 17 Feb 2026 16:14: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 GOnbCQKUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344899; 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=Tt6xtbA2n5hWWtncehHc/xG3dXOV3D/lx4LNtYgrSGg=; b=yfaYFCiTWWiEuIJ2K/fLCQY8nnG53jMvH8BHHS6IbdBmLibHq5/ppJdvhcO7cIVpTopwwl bAVLSIrcoPCzbg55+inn4xsc2XD5KDjlbImVMCn9rb+UAIezoLhBp9AY9hncydFU5k4S/7 4dO8y6vfQ+IXW0YUousjb81Oe61Y1bY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344899; 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=Tt6xtbA2n5hWWtncehHc/xG3dXOV3D/lx4LNtYgrSGg=; b=GBD+PKgsMwqDHBX6xHGmwK0W8BWegj7Nee3jUl+QxigtVqQrRVA7SidcKcKQBTSEZ3eRYw 35lEh7BeFmF32VDQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=yfaYFCiT; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=GBD+PKgs DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344899; 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=Tt6xtbA2n5hWWtncehHc/xG3dXOV3D/lx4LNtYgrSGg=; b=yfaYFCiTWWiEuIJ2K/fLCQY8nnG53jMvH8BHHS6IbdBmLibHq5/ppJdvhcO7cIVpTopwwl bAVLSIrcoPCzbg55+inn4xsc2XD5KDjlbImVMCn9rb+UAIezoLhBp9AY9hncydFU5k4S/7 4dO8y6vfQ+IXW0YUousjb81Oe61Y1bY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344899; 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=Tt6xtbA2n5hWWtncehHc/xG3dXOV3D/lx4LNtYgrSGg=; b=GBD+PKgsMwqDHBX6xHGmwK0W8BWegj7Nee3jUl+QxigtVqQrRVA7SidcKcKQBTSEZ3eRYw 35lEh7BeFmF32VDQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 07/32] migration: Introduce qemu_savevm_send_* helpers Date: Tue, 17 Feb 2026 13:14:18 -0300 Message-ID: <20260217161443.12738-8-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 9A4A83E725 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345150215154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Split qemu_savevm_state_header() into two parts. This paves way for a reuse elsewhere. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-2-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 62 +++++++++++++++++++++++++++------------------- migration/savevm.h | 1 + 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 3dc812a7bb..e26656cca3 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1282,38 +1282,48 @@ void qemu_savevm_non_migratable_list(strList **reas= ons) } } =20 -void qemu_savevm_state_header(QEMUFile *f) +void qemu_savevm_send_header(QEMUFile *f) { - MigrationState *s =3D migrate_get_current(); - JSONWriter *vmdesc =3D s->vmdesc; - Error *local_err =3D NULL; - trace_savevm_state_header(); qemu_put_be32(f, QEMU_VM_FILE_MAGIC); qemu_put_be32(f, QEMU_VM_FILE_VERSION); +} =20 +static void qemu_savevm_send_configuration(MigrationState *s, QEMUFile *f) +{ + JSONWriter *vmdesc =3D s->vmdesc; + Error *local_err =3D NULL; + + qemu_put_byte(f, QEMU_VM_CONFIGURATION); + + if (vmdesc) { + /* + * This starts the main json object and is paired with the + * json_writer_end_object in + * qemu_savevm_state_complete_precopy_non_iterable + */ + json_writer_start_object(vmdesc, NULL); + json_writer_start_object(vmdesc, "configuration"); + } + + vmstate_save_state(f, &vmstate_configuration, &savevm_state, + vmdesc, &local_err); + if (local_err) { + error_report_err(local_err); + } + + if (vmdesc) { + json_writer_end_object(vmdesc); + } +} + +void qemu_savevm_state_header(QEMUFile *f) +{ + MigrationState *s =3D migrate_get_current(); + + qemu_savevm_send_header(f); if (s->send_configuration) { - qemu_put_byte(f, QEMU_VM_CONFIGURATION); - - if (vmdesc) { - /* - * This starts the main json object and is paired with the - * json_writer_end_object in - * qemu_savevm_state_complete_precopy_non_iterable - */ - json_writer_start_object(vmdesc, NULL); - json_writer_start_object(vmdesc, "configuration"); - } - - vmstate_save_state(f, &vmstate_configuration, &savevm_state, - vmdesc, &local_err); - if (local_err) { - error_report_err(local_err); - } - - if (vmdesc) { - json_writer_end_object(vmdesc); - } + qemu_savevm_send_configuration(s, f); } } =20 diff --git a/migration/savevm.h b/migration/savevm.h index 125a2507b7..5d815af742 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -37,6 +37,7 @@ int qemu_savevm_state_prepare(Error **errp); int qemu_savevm_state_setup(QEMUFile *f, Error **errp); bool qemu_savevm_state_guest_unplug_pending(void); int qemu_savevm_state_resume_prepare(MigrationState *s); +void qemu_savevm_send_header(QEMUFile *f); void qemu_savevm_state_header(QEMUFile *f); int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); void qemu_savevm_state_cleanup(void); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345061; cv=none; d=zohomail.com; s=zohoarc; b=RKER7gJ54LgePUSbSGuRHPrq7aLGv0AH5A9AwCsXjLn9hiXJgVWEiXnzgea0SO3DkCxv7bDl0PrsIuVudRpxaHggD0jfA3U+K/hHudSsBa1Q70dllQjWHfN7LVMFg7BatBzttCfU/gJn0Y+Gx78vD4ENJWzVj+snwcm1Hprwcgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345061; 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=XlsCaOyOD25abPQ6B8feCX0XDPGY5YrK7gXdIAi5yRU=; b=dRhcJzczJo+A3zY6CDcG38lwZZtc0nwhsH0yOMliM5+lwX9R+mvNr7YJ3/lA+gkKwirngVIlIW49KqYuSStI/gKnJmaTNu/3w098OLyamcf7QBbIU7k18HFAismDsxeP50o49Dee/XSONEnaoaNStwov992FBlpITu+PlTCqmTc= 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 1771345061129878.5854643847802; Tue, 17 Feb 2026 08:17:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjQ-0001Ae-Ou; Tue, 17 Feb 2026 11:15:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjO-0001AT-SM for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:22 -0500 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 1vsNjN-00038e-7W for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:22 -0500 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 B9A9D3E6C2; Tue, 17 Feb 2026 16:15: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 0A2813EA66; Tue, 17 Feb 2026 16:14:59 +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 sK8uMAOUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:14:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344901; 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=XlsCaOyOD25abPQ6B8feCX0XDPGY5YrK7gXdIAi5yRU=; b=eKfflcMASAU024MsIxNtOV2El+JDVYNvSFXzhqwhj+SkU4Mqq0Px/QaKWHpSC4e0IY6+VM XVYPqKpKsACJKaXKwPcrruq8RPrmSj3t38A8zM6vFaZE1KSdWBjZzEnjnRLvPa6LRGnokR 89SDn0t27QGsJosjWuFh5HoeWb2yU8A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344901; 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=XlsCaOyOD25abPQ6B8feCX0XDPGY5YrK7gXdIAi5yRU=; b=V0e9QTrjevUsqmWeo49ixHwSK248lQZ/xiLN0Rr1G2sQdV0mYiXyXubr5iv7EttPFpkdLA 4SarACtgGG2QUKCQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=eKfflcMA; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=V0e9QTrj DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344901; 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=XlsCaOyOD25abPQ6B8feCX0XDPGY5YrK7gXdIAi5yRU=; b=eKfflcMASAU024MsIxNtOV2El+JDVYNvSFXzhqwhj+SkU4Mqq0Px/QaKWHpSC4e0IY6+VM XVYPqKpKsACJKaXKwPcrruq8RPrmSj3t38A8zM6vFaZE1KSdWBjZzEnjnRLvPa6LRGnokR 89SDn0t27QGsJosjWuFh5HoeWb2yU8A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344901; 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=XlsCaOyOD25abPQ6B8feCX0XDPGY5YrK7gXdIAi5yRU=; b=V0e9QTrjevUsqmWeo49ixHwSK248lQZ/xiLN0Rr1G2sQdV0mYiXyXubr5iv7EttPFpkdLA 4SarACtgGG2QUKCQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 08/32] migration: Use qemu_savevm_send_header() in qemu_save_device_state() Date: Tue, 17 Feb 2026 13:14:19 -0300 Message-ID: <20260217161443.12738-9-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: B9A9D3E6C2 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345062823154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Reduces duplication of the other path where we also send the same header. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-3-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index e26656cca3..64bf445c98 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1872,8 +1872,7 @@ int qemu_save_device_state(QEMUFile *f) SaveStateEntry *se; =20 if (!migration_in_colo_state()) { - qemu_put_be32(f, QEMU_VM_FILE_MAGIC); - qemu_put_be32(f, QEMU_VM_FILE_VERSION); + qemu_savevm_send_header(f); } cpu_synchronize_all_states(); =20 --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344987; cv=none; d=zohomail.com; s=zohoarc; b=hrDOXnnUm7YCrvG74681lDE3eEXAVcXFkmZOQkQsJulIL2g/GRr9UO0fIy3qoanHcprUfCLOJvmTW2T7Fd1LEyvcKbAFmXUZQQvXQrw6lGvYfWMix6gdnC+87qunZzSJTKRv2S4B3FhYqj7fdnvO4MyxGizXXUJUNZA3tosW/UM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344987; 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=58uwS38Uq+psWbfenxNWR6JD7znOOEGkUWjLg3GIe/Q=; b=mdu5GMCWZX4Df16FUNMU24yahykJ1PXklsQswy60vuoSYJMuE2b/6meTMM/SECn7GV0lnZFA/0hahEO8FBgvmu08/40t8x5MuG2YZgJsoVA2N0Lcgxg3XjTHuPy0gKwyhuJmS5545AbJT8ZOlHuz82JTetm8N85AG8OeBGiVs4k= 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 1771344987624990.9816963201189; Tue, 17 Feb 2026 08:16:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjS-0001BA-84; Tue, 17 Feb 2026 11:15:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjR-0001An-05 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:25 -0500 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 1vsNjP-00038l-AG for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:24 -0500 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 61ED65BCE9; Tue, 17 Feb 2026 16:15: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 288533EA66; Tue, 17 Feb 2026 16:15:01 +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 yFakNwWUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344903; 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=58uwS38Uq+psWbfenxNWR6JD7znOOEGkUWjLg3GIe/Q=; b=oEcUqkz5Ffl5xlBAUySTMfmPUa7UGmDA7wGm6N6l/6qiLpiaP/2LhXDceS64ChFSLUkFw6 g5Gn9J50nqD6iPYpymbCY38QWaYcNnVT1G/sGX4hbbpVCSWv1PQ4J3mj2bLbI/yI//6mjL HiJHuMuSjE5LTSpRIC0+1cMW3BpX9bk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344903; 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=58uwS38Uq+psWbfenxNWR6JD7znOOEGkUWjLg3GIe/Q=; b=0+HeBBH3mJEVYhjHK8Z7MHkcdXBEUF8+76iVh2zrzRQgwtqjNK6N95Ez4PgAuZ9HfIwcis ddcCl7mu2eSr6SBw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344903; 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=58uwS38Uq+psWbfenxNWR6JD7znOOEGkUWjLg3GIe/Q=; b=oEcUqkz5Ffl5xlBAUySTMfmPUa7UGmDA7wGm6N6l/6qiLpiaP/2LhXDceS64ChFSLUkFw6 g5Gn9J50nqD6iPYpymbCY38QWaYcNnVT1G/sGX4hbbpVCSWv1PQ4J3mj2bLbI/yI//6mjL HiJHuMuSjE5LTSpRIC0+1cMW3BpX9bk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344903; 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=58uwS38Uq+psWbfenxNWR6JD7znOOEGkUWjLg3GIe/Q=; b=0+HeBBH3mJEVYhjHK8Z7MHkcdXBEUF8+76iVh2zrzRQgwtqjNK6N95Ez4PgAuZ9HfIwcis ddcCl7mu2eSr6SBw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 09/32] migration: Remove one migration_in_colo_state() occurance Date: Tue, 17 Feb 2026 13:14:20 -0300 Message-ID: <20260217161443.12738-10-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: 1771344990120154101 Content-Type: text/plain; charset="utf-8" From: Peter Xu Move the send header operation directly into Xen's QMP command, as COLO doesn't need it. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-4-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 64bf445c98..61e873d90c 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1871,9 +1871,6 @@ int qemu_save_device_state(QEMUFile *f) Error *local_err =3D NULL; SaveStateEntry *se; =20 - if (!migration_in_colo_state()) { - qemu_savevm_send_header(f); - } cpu_synchronize_all_states(); =20 QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { @@ -3335,6 +3332,7 @@ void qmp_xen_save_devices_state(const char *filename,= bool has_live, bool live, qio_channel_set_name(QIO_CHANNEL(ioc), "migration-xen-save-state"); f =3D qemu_file_new_output(QIO_CHANNEL(ioc)); object_unref(OBJECT(ioc)); + qemu_savevm_send_header(f); ret =3D qemu_save_device_state(f); if (ret < 0 || qemu_fclose(f) < 0) { error_setg(errp, "saving Xen device state failed"); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345023; cv=none; d=zohomail.com; s=zohoarc; b=lnDyisAb9jO28ClTMGfyXzFvy8vBVwKk2wFLUi5uiHal6o4ONVWIYFbp53rzykJGb0Vr3bgLKLqNNY6KYZUgWEYOVLCB/QN7ZsJ8C/2exdXSHtWAuV5tWVq+MdW5WHuplT1JdBjP2TdClTmqKBQPffjihUySSMv8b2pBEcE7t/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345023; 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=12dko+5B3CXqUql9h4MUpE37+TD98BvnCR9Kf7nwxg8=; b=NZmFIoobuvKJK0wt4wjP5nKJkzU1O3Ye5dkyW3ryIsFrV8OZW9BMatluP2REqR3TOK1VbQ93ULRmWYjl1fSzZAAXWZEw5XZPnJqvqIUVeHye1jDO/k7YlLTAkCsiNZKJ0ULA4iZ6EAZwmtwJ6YE9qJjpHZ0DUUrr1ItkfdY9blo= 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 1771345023038768.3431115992606; Tue, 17 Feb 2026 08:17:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjY-0001Bv-3R; Tue, 17 Feb 2026 11:15:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjW-0001Bc-Ne for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:30 -0500 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 1vsNjS-00039E-Rb for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:28 -0500 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 0CDAC3E718; Tue, 17 Feb 2026 16:15: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 C4E263EA66; Tue, 17 Feb 2026 16:15:03 +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 EBYcIgeUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344905; 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=12dko+5B3CXqUql9h4MUpE37+TD98BvnCR9Kf7nwxg8=; b=bR7FZYuKM9SltfKzD1ysqHZelKQe5UscxPjU0ihx3EDiF85RP6IpHSM/GSBkzkhCu86fVq kXm4YrXatVXwE2S+nAB/X8RlFNxq4GisXHl/5VK9ZMaeqEB7mFs+HsYeYYeNGNBfl2q/gB kEiCNY8YPPDqXEEZmONOQXFGr81rT7w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344905; 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=12dko+5B3CXqUql9h4MUpE37+TD98BvnCR9Kf7nwxg8=; b=rKwfyPjTqKdidDijM2kNOBUsTb28S/54xevOWr7weGMlXU6C1iaRCU+uKIlJJ1UB/NbkY9 uDkbq8RQ2fXGLVDw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344905; 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=12dko+5B3CXqUql9h4MUpE37+TD98BvnCR9Kf7nwxg8=; b=bR7FZYuKM9SltfKzD1ysqHZelKQe5UscxPjU0ihx3EDiF85RP6IpHSM/GSBkzkhCu86fVq kXm4YrXatVXwE2S+nAB/X8RlFNxq4GisXHl/5VK9ZMaeqEB7mFs+HsYeYYeNGNBfl2q/gB kEiCNY8YPPDqXEEZmONOQXFGr81rT7w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344905; 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=12dko+5B3CXqUql9h4MUpE37+TD98BvnCR9Kf7nwxg8=; b=rKwfyPjTqKdidDijM2kNOBUsTb28S/54xevOWr7weGMlXU6C1iaRCU+uKIlJJ1UB/NbkY9 uDkbq8RQ2fXGLVDw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 10/32] migration/savevm: Remove SaveStateEntry.is_ram Date: Tue, 17 Feb 2026 13:14:21 -0300 Message-ID: <20260217161443.12738-11-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345023747158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu It's neither accurate nor necessary. Use a proper helper to detect if it's an iterable savevm state entry instead. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-5-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 61e873d90c..f1cd8c913d 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -249,7 +249,6 @@ typedef struct SaveStateEntry { const VMStateDescription *vmsd; void *opaque; CompatEntry *compat; - int is_ram; } SaveStateEntry; =20 typedef struct SaveState { @@ -816,10 +815,6 @@ int register_savevm_live(const char *idstr, se->ops =3D ops; se->opaque =3D opaque; se->vmsd =3D NULL; - /* if this is a live_savem then set is_ram */ - if (ops->save_setup !=3D NULL) { - se->is_ram =3D 1; - } =20 pstrcat(se->idstr, sizeof(se->idstr), idstr); =20 @@ -1866,6 +1861,12 @@ void qemu_savevm_live_state(QEMUFile *f) qemu_put_byte(f, QEMU_VM_EOF); } =20 +/* Is a save state entry iterable (e.g. RAM)? */ +static bool qemu_savevm_se_iterable(SaveStateEntry *se) +{ + return se->ops && se->ops->save_setup; +} + int qemu_save_device_state(QEMUFile *f) { Error *local_err =3D NULL; @@ -1876,7 +1877,7 @@ int qemu_save_device_state(QEMUFile *f) QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { int ret; =20 - if (se->is_ram) { + if (qemu_savevm_se_iterable(se)) { continue; } ret =3D vmstate_save(f, se, NULL, &local_err); @@ -2648,7 +2649,7 @@ qemu_loadvm_section_start_full(QEMUFile *f, uint8_t t= ype, Error **errp) se->load_section_id =3D section_id; =20 /* Validate if it is a device's state */ - if (xen_enabled() && se->is_ram) { + if (xen_enabled() && qemu_savevm_se_iterable(se)) { error_setg(errp, "loadvm: %s RAM loading not allowed on Xen", idst= r); return -EINVAL; } --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345236; cv=none; d=zohomail.com; s=zohoarc; b=JTNXCYmmO2IhEZeRi/yh3JesH6lR0qHV6zFupwQvKTg1Q/w/hsBiempyzzP8+wYysmU8B2cg3tSu1rn0fIqHf12VL/gOcSITEkhkvQOhf2f0IO/MWHYDuIzaQBmcnIb/AZd7uyFAJ7IiYP2ClXrGGBruZ3CTn8Aa2OBE0n0M4dE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345236; 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=QSqQyE8jOWlhQKDEeWRnmggAxcKfbhhB1Ozyl0vCABs=; b=d9/jzhoLYGqx5TdI12pxBOxOQUP+HlP8eK44wTrn2hcJrUX+YHn4Xa26YteCDtweD8IWlQSQ8Bhi+vDrC2UDniU3PAjVEds3pwbkCxaFvgLUIhV9jHh94rWQ78alsvGnGpMcveDh5vP9chPuZ8zV/8TYH70KbPPPbeoXG1+joM8= 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 1771345236256494.47033629768794; Tue, 17 Feb 2026 08:20:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjh-0001DM-5q; Tue, 17 Feb 2026 11:15:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjd-0001Cp-Fz for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:38 -0500 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 1vsNjb-0003A1-HB for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:37 -0500 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 A72263E728; Tue, 17 Feb 2026 16:15:06 +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 6EB633EA66; Tue, 17 Feb 2026 16:15: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 cAwcDQmUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344906; 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=QSqQyE8jOWlhQKDEeWRnmggAxcKfbhhB1Ozyl0vCABs=; b=s+EmT0F83l5AuMrcPRiZM/sunJxd2dPngZGuaFm9x3pepSsH36wjF/8q1QUyiWN5ZaP0hN Xlyt86I3lJ6PUiZsWq8Pn3CpAf/eFIDoAP9MrQGRuagU6wbsvOtGx2BOcOt+9EozX0nyyT wamlOeZb6Y7ArMR6hNO5+S3JK9xd5ZU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344906; 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=QSqQyE8jOWlhQKDEeWRnmggAxcKfbhhB1Ozyl0vCABs=; b=YBwrwXdtyP8kj6h8tlRJ4lnIsQ7LoXpKBaUfE0Uvpf4WsK0A6Dcr2lUAwNs7IGrqumGRGn eVsCNsC/X+0N+EAw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=s+EmT0F8; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=YBwrwXdt DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344906; 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=QSqQyE8jOWlhQKDEeWRnmggAxcKfbhhB1Ozyl0vCABs=; b=s+EmT0F83l5AuMrcPRiZM/sunJxd2dPngZGuaFm9x3pepSsH36wjF/8q1QUyiWN5ZaP0hN Xlyt86I3lJ6PUiZsWq8Pn3CpAf/eFIDoAP9MrQGRuagU6wbsvOtGx2BOcOt+9EozX0nyyT wamlOeZb6Y7ArMR6hNO5+S3JK9xd5ZU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344906; 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=QSqQyE8jOWlhQKDEeWRnmggAxcKfbhhB1Ozyl0vCABs=; b=YBwrwXdtyP8kj6h8tlRJ4lnIsQ7LoXpKBaUfE0Uvpf4WsK0A6Dcr2lUAwNs7IGrqumGRGn eVsCNsC/X+0N+EAw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 11/32] migration/colo: Unwrap qemu_savevm_live_state() Date: Tue, 17 Feb 2026 13:14:22 -0300 Message-ID: <20260217161443.12738-12-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: A72263E728 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345236880158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu It's only used in COLO path and only contains two calls. Unwrap the function. It paves way for further reduce special COLO paths on sync. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-6-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/colo.c | 3 ++- migration/savevm.c | 7 ------- migration/savevm.h | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index db783f6fa7..e05736ecf0 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -471,7 +471,8 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, * TODO: We may need a timeout mechanism to prevent COLO process * to be blocked here. */ - qemu_savevm_live_state(s->to_dst_file); + qemu_savevm_state_complete_precopy(s->to_dst_file, true); + qemu_put_byte(s->to_dst_file, QEMU_VM_EOF); =20 qemu_fflush(fb); =20 diff --git a/migration/savevm.c b/migration/savevm.c index f1cd8c913d..529cf310e0 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1854,13 +1854,6 @@ cleanup: return ret; } =20 -void qemu_savevm_live_state(QEMUFile *f) -{ - /* save QEMU_VM_SECTION_END section */ - qemu_savevm_state_complete_precopy(f, true); - qemu_put_byte(f, QEMU_VM_EOF); -} - /* Is a save state entry iterable (e.g. RAM)? */ static bool qemu_savevm_se_iterable(SaveStateEntry *se) { diff --git a/migration/savevm.h b/migration/savevm.h index 5d815af742..528607f09e 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -64,7 +64,6 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, c= onst char *name, uint64_t *start_list, uint64_t *length_list); void qemu_savevm_send_colo_enable(QEMUFile *f); -void qemu_savevm_live_state(QEMUFile *f); int qemu_save_device_state(QEMUFile *f); =20 int qemu_loadvm_state(QEMUFile *f, Error **errp); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345160; cv=none; d=zohomail.com; s=zohoarc; b=ApKjQvp7mrIr5bYNwAGA5VGfEdwenHQSKH/XhSQ2Gf90r3pcqpB4Ie2Av4f5L8oMGDh4RrohZSVe+C7ZkCfUSbhroIfB7Skps+LOZspo5qZ3RlCjDTxMnjd8FOnERa+/fMcZVpLMEmOluEp/0IFGHPh4tbJvQz+Sk6Vnggx7NDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345160; 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=Vgr4OUEoVoeYd3VVabk+aM71mxTYEKfQzhm4STMOtHw=; b=L8w3BuXBJuQRG7YwMBFFGB4hOb/rs+KaOu1FC67PpVoot/u1PzmbtpnCu+5C9ENCu2XiKtcrBlIHJGpsr6/5xf9ecGJ6+fhO3K679Pg7WpvRhpkF6wwOeROLEbLanZAz9vbHaOsRl5CAjhIGfkWmMgoD4Y/lTo5cfkP+ZwxupAY= 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 1771345160644713.5499146110404; Tue, 17 Feb 2026 08:19:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjx-0001dU-Q5; Tue, 17 Feb 2026 11:15:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjj-0001Dx-Rf for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:43 -0500 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 1vsNji-0003Aw-4t for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:43 -0500 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 550D53E779; Tue, 17 Feb 2026 16:15: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 175EF3EA66; Tue, 17 Feb 2026 16:15:06 +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 kBxmMwqUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344908; 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=Vgr4OUEoVoeYd3VVabk+aM71mxTYEKfQzhm4STMOtHw=; b=sNfWDZx46D/p8bORu0qWpdnUKS59SHiWX+l/WTmDAHSdACm7Pzsl74rerXuO33KP0XpdI+ e8DnFq60zwVonO1bcXG8ch7jkbmwZLwxqRYw4/yS56AS2J2aNuieyhD8aB5sLje2ml5mD1 lIselshu/Pv/bk1O0w3Q5E1j5yTJqxU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344908; 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=Vgr4OUEoVoeYd3VVabk+aM71mxTYEKfQzhm4STMOtHw=; b=g78UlJaIHlwWzMKSza+JherGwz0M8KLnSBmshZOFaXgTqe8Zrj536nVPfFcu492Q9wtluX 1wXGR/SBnQw/AMCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344908; 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=Vgr4OUEoVoeYd3VVabk+aM71mxTYEKfQzhm4STMOtHw=; b=sNfWDZx46D/p8bORu0qWpdnUKS59SHiWX+l/WTmDAHSdACm7Pzsl74rerXuO33KP0XpdI+ e8DnFq60zwVonO1bcXG8ch7jkbmwZLwxqRYw4/yS56AS2J2aNuieyhD8aB5sLje2ml5mD1 lIselshu/Pv/bk1O0w3Q5E1j5yTJqxU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344908; 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=Vgr4OUEoVoeYd3VVabk+aM71mxTYEKfQzhm4STMOtHw=; b=g78UlJaIHlwWzMKSza+JherGwz0M8KLnSBmshZOFaXgTqe8Zrj536nVPfFcu492Q9wtluX 1wXGR/SBnQw/AMCg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 12/32] migration: Remove call to send switchover start event in colo/savevm Date: Tue, 17 Feb 2026 13:14:23 -0300 Message-ID: <20260217161443.12738-13-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345162373154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu COLO (in case of periodically checkpointing) already have switchover happened before hand. This switchover_start feature never applies to COLO. Savevm for snapshot doesn't have switchover phase and VM is stopped for the whole process. Remove both. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-7-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/colo.c | 2 -- migration/savevm.c | 1 - 2 files changed, 3 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index e05736ecf0..c344943173 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -453,8 +453,6 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, goto out; } =20 - qemu_savevm_maybe_send_switchover_start(s->to_dst_file); - /* Note: device state is saved into buffer */ ret =3D qemu_save_device_state(fb); =20 diff --git a/migration/savevm.c b/migration/savevm.c index 529cf310e0..d41be3a4a2 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1830,7 +1830,6 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) =20 ret =3D qemu_file_get_error(f); if (ret =3D=3D 0) { - qemu_savevm_maybe_send_switchover_start(f); qemu_savevm_state_complete_precopy(f, false); ret =3D qemu_file_get_error(f); } --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345012; cv=none; d=zohomail.com; s=zohoarc; b=L/Dos1eTnkRkPnowjz3S5tyScJxgx8GA3KHpbGxB/Nv/9wI4e3q4h++FvoKMkxFtg4eqetfaMBtDMFcfI48slEVYegmIRRGh98u0m11MzXrF8x7z1/AmRAsOfVorwKLFAs2TaiG9nPLYmPd+xC6Ewsss9XIwJIwz6kJQO3bKQF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345012; 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=ZMDymZ9z5EH+qvOkmE6WNID+zsoFxrt6B20Lh0uqVi4=; b=jS4H5zGCAtIDFvw9a8mVgJVKkVEcVT/n0uuA8jMNxjMZuwLdhPOHw5aYyyWbYe0fQJpbIHSvGQCSwPcdtr4pI5mB3DgXV+2S0DvJixtDrciGUCJ6MjbaGmUiRiQPOMR0P9RTzD/8qQYniE6F3iIzBqB4pZQziW6mH5LwtDUzaX8= 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 1771345012513999.6894810176036; Tue, 17 Feb 2026 08:16:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjb-0001CT-OY; Tue, 17 Feb 2026 11:15:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjY-0001Bw-92 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:32 -0500 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 1vsNjW-00039N-GI for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:31 -0500 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 EC5875BCF4; Tue, 17 Feb 2026 16:15:09 +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 B36EC3EA66; Tue, 17 Feb 2026 16:15:08 +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 8InqHQyUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344910; 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=ZMDymZ9z5EH+qvOkmE6WNID+zsoFxrt6B20Lh0uqVi4=; b=H3VxDW6Q57FjfLRUsO44wjndma68208XtRU0vEpt2xp7QP3b/xobM8FCRr6CcPilxgXSsP PQFb76xS5PM0iud7cbZDIGgm/By/DFe7C2QQgMbzQFtoSBF9A9G2QPR1vocEQCI8dEqqoP EefMBoNgVRjEXBnYl4ZBieoAoRWVe+c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344910; 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=ZMDymZ9z5EH+qvOkmE6WNID+zsoFxrt6B20Lh0uqVi4=; b=2sfMXXLZqrzc4Y+SHGAWKWkBD/Amzko7j5skKhpMHTuxY+EQzYVDU+RdeJ55pKxoAuM2u8 GifInaoWXWCVTWDw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344909; 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=ZMDymZ9z5EH+qvOkmE6WNID+zsoFxrt6B20Lh0uqVi4=; b=BZ/Q8Mt7GtSwK2xN6fCbq19s93B+r75bG6wEKYKoP/KawQ/8Pn5GbWm07eJVaWitt+2Hhv 9MJ/0YFWEgMOdHFICLrddU7SlRFvJKPlEN2rjbKPshklVQvF47USCQRvyIJCKEcfM4ZVGw pzyigSxL0rabL6GkOKP0kCSNJqobuAg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344909; 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=ZMDymZ9z5EH+qvOkmE6WNID+zsoFxrt6B20Lh0uqVi4=; b=B91qhMNeyo/yn2/lKVP24YYHUqDHvKfTznhoWmyGu7b1tqYRJ2OrynBAlFGSi6yKAERqhH 0Q8VCjIVLQaLdHBQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 13/32] colo: Forbid VM resume during checkpointing Date: Tue, 17 Feb 2026 13:14:24 -0300 Message-ID: <20260217161443.12738-14-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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: 1771345014021154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu COLO will stop the VM during each checkpoint on either PVM or SVM. Accidentally resuming the VM during the window might be fatal because it may cause the RAM and devices state to misalign, corrupting the checkpoint. Hence forbid VM resume during the process. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-8-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- monitor/qmp-cmds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 1ca44fbd72..0c409c27dc 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -84,6 +84,9 @@ void qmp_cont(Error **errp) } else if (runstate_check(RUN_STATE_FINISH_MIGRATE)) { error_setg(errp, "Migration is not finalized yet"); return; + } else if (runstate_check(RUN_STATE_COLO)) { + error_setg(errp, "COLO checkpoint in progress"); + return; } =20 for (blk =3D blk_next(NULL); blk; blk =3D blk_next(blk)) { --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345014; cv=none; d=zohomail.com; s=zohoarc; b=T8FiahulI2YgSynIl4rfxrW+M4/tN370wRZ6l8wJA47XgmDaRVxyefASpPt4vL3ijQycmisAreJNLZXeT5ycNKmY6hTBwvxmeigCGxrK4Gt6reDxi627vR11sUXc/HvwOFo/No0zFPXwcCuL2QqZQjiqXwTdtSI4F82S0OinqzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345014; 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=yX5YQTDSfJy7hHPqtdXptqP9rJwBss6Civ6j+kTSOYQ=; b=dbDDtggOyOMUcOpS7cBYtu4MZKymywAYqQg5PW3btrMKChwhvHSXrmxcByM9Vx4C37UVQeyA3l+jdLc1piYBb6TGIV8X1mvc6mXZ1rIgKJ/ckL5AlFJxaQWia3VdLRx6eIOzLEOIwvVW/6mAsMGuOorYkaSlJd3lIBn9ghK+F/k= 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 1771345014133651.020975131113; Tue, 17 Feb 2026 08:16:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNji-0001Dk-J5; Tue, 17 Feb 2026 11:15:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNje-0001Cx-OY for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:39 -0500 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 1vsNjc-0003AE-A3 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:38 -0500 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 968BA5BD14; Tue, 17 Feb 2026 16:15:11 +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 5C2B23EA66; Tue, 17 Feb 2026 16:15: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 8I2XCA6UlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344911; 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=yX5YQTDSfJy7hHPqtdXptqP9rJwBss6Civ6j+kTSOYQ=; b=RzSjt13U88xdDjSTLgEkJWOCHED0aR9vQJApVvRxlpfIzie3RQULIuwTJ8e4asEUYw1iWE mKM9rv+SfLXSkyTZFLxnAOdbmaA0d0qbzgsrgufwQL5m5Bp6NEz3VgNteI4B4ud7pg2Ox9 5jaEEcitrnbyPKZFkQ+b+rX5CWCeVcQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344911; 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=yX5YQTDSfJy7hHPqtdXptqP9rJwBss6Civ6j+kTSOYQ=; b=0TkCuQzgY8emO8/IuIh5yLI+lGMp4cTLsrTppAgEWSs74+Wenu+fHvHKCDmEO5gfXMM2t1 ZLTNFnlWsRX9+1CQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=RzSjt13U; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=0TkCuQzg DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344911; 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=yX5YQTDSfJy7hHPqtdXptqP9rJwBss6Civ6j+kTSOYQ=; b=RzSjt13U88xdDjSTLgEkJWOCHED0aR9vQJApVvRxlpfIzie3RQULIuwTJ8e4asEUYw1iWE mKM9rv+SfLXSkyTZFLxnAOdbmaA0d0qbzgsrgufwQL5m5Bp6NEz3VgNteI4B4ud7pg2Ox9 5jaEEcitrnbyPKZFkQ+b+rX5CWCeVcQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344911; 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=yX5YQTDSfJy7hHPqtdXptqP9rJwBss6Civ6j+kTSOYQ=; b=0TkCuQzgY8emO8/IuIh5yLI+lGMp4cTLsrTppAgEWSs74+Wenu+fHvHKCDmEO5gfXMM2t1 ZLTNFnlWsRX9+1CQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 14/32] migration/colo: Use the RAM iterable helper directly Date: Tue, 17 Feb 2026 13:14:25 -0300 Message-ID: <20260217161443.12738-15-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; 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: 968BA5BD14 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345016052154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu qemu_savevm_state_complete_precopy() has a weird parameter called "iterable_only". It's needed because COLO saves device states in advance. To make dropping that weird parameter easier, let COLO directly use the RAM iterator helper instead, which should make the code easier to read too. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-9-peterx@re= dhat.com Signed-off-by: Fabiano Rosas --- migration/colo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/colo.c b/migration/colo.c index c344943173..f92803dd29 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -469,7 +469,7 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, * TODO: We may need a timeout mechanism to prevent COLO process * to be blocked here. */ - qemu_savevm_state_complete_precopy(s->to_dst_file, true); + qemu_savevm_state_complete_precopy_iterable(s->to_dst_file, false); qemu_put_byte(s->to_dst_file, QEMU_VM_EOF); =20 qemu_fflush(fb); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345060; cv=none; d=zohomail.com; s=zohoarc; b=Jug9fimuBiF5OGo3w2zIvUfyfo7oGuxOrWKtmPbprP7bCFrQ4sn9qi9nPU/fceTxyWi8QyxVFWFLg+p+OFFGjegsQ4dYrn+iWJX3Y7ywjx8avDgbFK8Inv4+FvpvszuaTgm6cg1I4bZzdwSCY1Ty2pctblosD3/YqruIzW7QQOc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345060; 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=jyJVl0yIl7sY6W/V3dE11y4U1/YM7kU8aTXBlcEh2TQ=; b=P0a56lVryD5n4qtlBOwcehOWHMtmZqGprqHJwz5YOcgVJ4zgwyjneFoiPs9jITUhu4dXkVA/eBBbHv93Sc4Q+V1mYFYJRPiL/jhtgKrP3TtYpnw3D+5TeCH7K5b74Lk5TNNr7F1cx9T+/NuM0PzHX2ew7d4UR+C82jKUg9NqeWI= 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 177134506064777.14961384145704; Tue, 17 Feb 2026 08:17:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNjr-0001EV-J0; Tue, 17 Feb 2026 11:15:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjj-0001Dv-O7 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:43 -0500 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 1vsNji-0003Ay-3T for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:43 -0500 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 D50C65BD2F; Tue, 17 Feb 2026 16:15:13 +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 055E73EA66; Tue, 17 Feb 2026 16:15:11 +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 CPcDLw+UlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344913; 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=jyJVl0yIl7sY6W/V3dE11y4U1/YM7kU8aTXBlcEh2TQ=; b=W7bGqNYfCg8JZHxYziBVj7Z7MdhUyw0jMlowlQGh97JyWvVfXblG87ESMS8OfvD4Vd5tox MyP4uqrYmhY20uuveX+8EgT0RGKM5DXnpkrZZ9rwQRIfhWGaoIXM98qziDPZhMToCpQR0o L9xG5ma/H5PCTspGykEtOOajFBwrvJk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344913; 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=jyJVl0yIl7sY6W/V3dE11y4U1/YM7kU8aTXBlcEh2TQ=; b=V0ycea1R9j5EhLi4Qh/0V3vjCtDxp219GtI6TkmD3S+izpToiK24NEwZPhBkIoBGPZu22I 8/DH/k+aylBNExCA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=W7bGqNYf; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=V0ycea1R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344913; 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=jyJVl0yIl7sY6W/V3dE11y4U1/YM7kU8aTXBlcEh2TQ=; b=W7bGqNYfCg8JZHxYziBVj7Z7MdhUyw0jMlowlQGh97JyWvVfXblG87ESMS8OfvD4Vd5tox MyP4uqrYmhY20uuveX+8EgT0RGKM5DXnpkrZZ9rwQRIfhWGaoIXM98qziDPZhMToCpQR0o L9xG5ma/H5PCTspGykEtOOajFBwrvJk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344913; 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=jyJVl0yIl7sY6W/V3dE11y4U1/YM7kU8aTXBlcEh2TQ=; b=V0ycea1R9j5EhLi4Qh/0V3vjCtDxp219GtI6TkmD3S+izpToiK24NEwZPhBkIoBGPZu22I 8/DH/k+aylBNExCA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 15/32] migration/colo: Document qemu_fflush(fb) Date: Tue, 17 Feb 2026 13:14:26 -0300 Message-ID: <20260217161443.12738-16-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; 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: D50C65BD2F 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: 1771345061917158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu COLO caches all device states in a buffer channel `fb'. Add some comments explaining the flush, that (1) it's the `fb' not the main channel, (2) on what it updates. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-10-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/colo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index f92803dd29..1b94e0f0ee 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -472,12 +472,14 @@ static int colo_do_checkpoint_transaction(MigrationSt= ate *s, qemu_savevm_state_complete_precopy_iterable(s->to_dst_file, false); qemu_put_byte(s->to_dst_file, QEMU_VM_EOF); =20 - qemu_fflush(fb); - /* * We need the size of the VMstate data in Secondary side, * With which we can decide how much data should be read. + * + * Flush the qemufile cache to make sure both bioc->usage and + * bioc->data contains the latest info. */ + qemu_fflush(fb); colo_send_message_value(s->to_dst_file, COLO_MESSAGE_VMSTATE_SIZE, bioc->usage, &local_err); if (local_err) { --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345199; cv=none; d=zohomail.com; s=zohoarc; b=UvKAjy6jN+WcFPixYPi+jVmBY4XU2m7tCGNpGp0+effK0G2Oq4kvRSG2Cx/KXiexy4QE0m9EusdE2USjmf0Afs/ovTfDycPDl15xilZ0GxmPO4xhhUyGoMilCuM4M8059y10h11OChnJr7LAIA2+cPK7hq1cZqG5mRH0KG6uJek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345199; 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=xkyeT7dds1sm7FK83yQLWS0CkUqXnbiS2O9oKsYDH18=; b=IBmfXPKrR/QmwJpMj96ZoZoCx4KQVEDe4Ka3JVrgyF0sU22wmdeBOwXvbw61Ti9NNcewrzTGu9Y9TA4BAw79aY00lP51d7Vo4mkkAEvl9pV1llnEERNWYWa31W9JrWZ1QW3i4n5Nv6FCA+FANiLBazcvtNgc/S87RaGcaBl6OdA= 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 1771345199013878.3613003506321; Tue, 17 Feb 2026 08:19:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNk1-0001re-SM; Tue, 17 Feb 2026 11:16:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjq-0001EU-4c for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:51 -0500 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 1vsNjo-0003Bn-E7 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:49 -0500 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 7D14C3E71C; Tue, 17 Feb 2026 16:15:15 +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 445F73EA66; Tue, 17 Feb 2026 16:15:14 +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 uMXPAhKUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344915; 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=xkyeT7dds1sm7FK83yQLWS0CkUqXnbiS2O9oKsYDH18=; b=0mU5LoMQlWT2u44KFRChoICEiVtPTmVHk2KQRMGtMxvOKDgiQAHD5jOV0V209Ewjo6SzZQ fXslSftzz0+n4IcW/d2a6/EvbYXJbAfpG9qJA7uzb5CQm4XmYLLI8WthISkBoWMaNTyOzP BStQLfedRXN8L+B1eYfKjDgkur6AUNk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344915; 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=xkyeT7dds1sm7FK83yQLWS0CkUqXnbiS2O9oKsYDH18=; b=SV+yoC2/KcmyFscvEH5wtYVhP/1HAhgdtkY34Mm4Q8s2BiGCT9rEFuBtRLNPu3GNEi7Evx ot60B5qp5QhrH1DA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344915; 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=xkyeT7dds1sm7FK83yQLWS0CkUqXnbiS2O9oKsYDH18=; b=0mU5LoMQlWT2u44KFRChoICEiVtPTmVHk2KQRMGtMxvOKDgiQAHD5jOV0V209Ewjo6SzZQ fXslSftzz0+n4IcW/d2a6/EvbYXJbAfpG9qJA7uzb5CQm4XmYLLI8WthISkBoWMaNTyOzP BStQLfedRXN8L+B1eYfKjDgkur6AUNk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344915; 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=xkyeT7dds1sm7FK83yQLWS0CkUqXnbiS2O9oKsYDH18=; b=SV+yoC2/KcmyFscvEH5wtYVhP/1HAhgdtkY34Mm4Q8s2BiGCT9rEFuBtRLNPu3GNEi7Evx ot60B5qp5QhrH1DA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 16/32] migration: Drop iterable_only in qemu_savevm_state_complete_precopy Date: Tue, 17 Feb 2026 13:14:27 -0300 Message-ID: <20260217161443.12738-17-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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.130; envelope-from=farosas@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345200922154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Now after removing the special case in COLO, we can drop this parameter. Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-11-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 2 +- migration/savevm.c | 12 +++++------- migration/savevm.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 850150a261..b7a2eee25c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2757,7 +2757,7 @@ static int migration_completion_precopy(MigrationStat= e *s) goto out_unlock; } =20 - ret =3D qemu_savevm_state_complete_precopy(s->to_dst_file, false); + ret =3D qemu_savevm_state_complete_precopy(s->to_dst_file); out_unlock: bql_unlock(); return ret; diff --git a/migration/savevm.c b/migration/savevm.c index d41be3a4a2..da9a60c73f 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1717,7 +1717,7 @@ int qemu_savevm_state_complete_precopy_non_iterable(Q= EMUFile *f, return 0; } =20 -int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only) +int qemu_savevm_state_complete_precopy(QEMUFile *f) { int ret; =20 @@ -1726,11 +1726,9 @@ int qemu_savevm_state_complete_precopy(QEMUFile *f, = bool iterable_only) return ret; } =20 - if (!iterable_only) { - ret =3D qemu_savevm_state_complete_precopy_non_iterable(f, false); - if (ret) { - return ret; - } + ret =3D qemu_savevm_state_complete_precopy_non_iterable(f, false); + if (ret) { + return ret; } =20 return qemu_fflush(f); @@ -1830,7 +1828,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) =20 ret =3D qemu_file_get_error(f); if (ret =3D=3D 0) { - qemu_savevm_state_complete_precopy(f, false); + qemu_savevm_state_complete_precopy(f); ret =3D qemu_file_get_error(f); } if (ret !=3D 0) { diff --git a/migration/savevm.h b/migration/savevm.h index 528607f09e..ea01ca63ec 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -42,7 +42,7 @@ void qemu_savevm_state_header(QEMUFile *f); int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); void qemu_savevm_state_cleanup(void); void qemu_savevm_state_complete_postcopy(QEMUFile *f); -int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only); +int qemu_savevm_state_complete_precopy(QEMUFile *f); void qemu_savevm_state_pending_exact(uint64_t *must_precopy, uint64_t *can_postcopy); void qemu_savevm_state_pending_estimate(uint64_t *must_precopy, --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345201; cv=none; d=zohomail.com; s=zohoarc; b=lzenpYlrypxK2YPBbhT2gl8pTjyZR1pteQ+q3YmOwnv44789Rzrzw7MHbrsEEE4X/6caA+uP3OwCq55DK9xkFIdOrAZs+hEmIt75auC3223jOSHUDSEsLbKnIJpHPZGl1LmBH5z4tu33SdHzIMzRbsP2ZZr6IgJQz5ZZQGRLpBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345201; 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=BUmJ0IvEJx3XS6jfar8Y6nO2F1CFsMvTWaMOiGZ8Zxs=; b=ZnrylUcWxsxewATU5MjYU2ZK+TocqmHkpywJrN5nDSzBe57+23uqGZxSCMXGTXZnV3xhcrSAhn9Z1EHpe7AgxMYq8g5msj/okq6wKqYSd+GxdYH9Cr0QI39uZ6XwkjS1sonV/bUsbS775mfs7dTLJeUBEeB9rjNEdDjM66MvDkU= 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 1771345201110125.58545915752347; Tue, 17 Feb 2026 08:20:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNk1-0001n0-5j; Tue, 17 Feb 2026 11:16:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNju-0001Um-M8 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:55 -0500 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 1vsNjt-0003CH-17 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:54 -0500 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 2F2173E735; Tue, 17 Feb 2026 16:15:17 +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 E0AF03EA67; Tue, 17 Feb 2026 16:15:15 +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 sK7wKBOUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344917; 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=BUmJ0IvEJx3XS6jfar8Y6nO2F1CFsMvTWaMOiGZ8Zxs=; b=d6pWS94SYunPOkA16pGtKYY0nPlEVTUYUkhBmfw52WVPp+2dBlSFaXb8Zwaslej95Fxfbo rNDkuJXzAPBKaLmdgPIO6KqCwCMKHpXMoyFEpzzyIa9new/Rg2iOtBI0+RdUb4wWQfESn3 2bu/7vChDQWunxvLt1wTIxGgCJB9W5Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344917; 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=BUmJ0IvEJx3XS6jfar8Y6nO2F1CFsMvTWaMOiGZ8Zxs=; b=pN0pnv2VYZgIfWoj+6ZFFerPuyOjSwqqT/jvHI8Qw1S4TuaciJBhdM6B5ILAumD1Hf9DBF vxJgPH4Os+08F8Ag== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=d6pWS94S; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=pN0pnv2V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344917; 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=BUmJ0IvEJx3XS6jfar8Y6nO2F1CFsMvTWaMOiGZ8Zxs=; b=d6pWS94SYunPOkA16pGtKYY0nPlEVTUYUkhBmfw52WVPp+2dBlSFaXb8Zwaslej95Fxfbo rNDkuJXzAPBKaLmdgPIO6KqCwCMKHpXMoyFEpzzyIa9new/Rg2iOtBI0+RdUb4wWQfESn3 2bu/7vChDQWunxvLt1wTIxGgCJB9W5Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344917; 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=BUmJ0IvEJx3XS6jfar8Y6nO2F1CFsMvTWaMOiGZ8Zxs=; b=pN0pnv2VYZgIfWoj+6ZFFerPuyOjSwqqT/jvHI8Qw1S4TuaciJBhdM6B5ILAumD1Hf9DBF vxJgPH4Os+08F8Ag== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 17/32] migration: Drop qemu_file_set_error() when save non-iterable fails Date: Tue, 17 Feb 2026 13:14:28 -0300 Message-ID: <20260217161443.12738-18-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 2F2173E735 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: 1771345202590158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu All users of qemu_savevm_state_complete_precopy_non_iterable() process return values. There's no need to set error on qemufile (which we likely should remove gradually across the tree). Remove it for possible code dedup to happen later. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-12-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index da9a60c73f..9d2109718a 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1688,7 +1688,6 @@ int qemu_savevm_state_complete_precopy_non_iterable(Q= EMUFile *f, if (ret) { migrate_error_propagate(ms, error_copy(local_err)); error_report_err(local_err); - qemu_file_set_error(f, ret); return ret; } =20 --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345211; cv=none; d=zohomail.com; s=zohoarc; b=QT7usiyjRCi+R13nqmHhUlkp38fMv/0ZEmDMjThkPEA66oxa+cmbnDr+SwVizYiAcARHA4NnDIC7KbOCc5niY7QkHeadBoTCuKM4QaGRv2JkR/vWUnNGfMflgvIdTotz4J0uLcsO/CYs6nZ8gM6RyG3jOM3UVLoZJEnCDkxgf9Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345211; 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=BjlbIXI20cfQeOQ/SCIWC1ottJ3vSZOOzDl3c4Yx3Vk=; b=h51Zc/BDhcATEl3q1ZAM9KNwgg8N0T/kxrJQYzXJTQwkoM4A3BCd75oFCinaABXy9o35NXs70GnI7Iz/ijuKYCtLOe78ANfO+2WSIcaKqUB4KmRA3WMkZNIEZk7FNhLjxwej+D6YH/NfAwXZMOOw3HQrgem+ez/yEzPK5e1g8s4= 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 1771345211151814.8435110745637; Tue, 17 Feb 2026 08:20:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNk0-0001lU-BR; Tue, 17 Feb 2026 11:16:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjp-0001ET-RN for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:51 -0500 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 1vsNjn-0003Bl-QO for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:49 -0500 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 C962E5BCEA; Tue, 17 Feb 2026 16:15:18 +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 8EB663EA66; Tue, 17 Feb 2026 16:15:17 +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 4KzqFBWUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344918; 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=BjlbIXI20cfQeOQ/SCIWC1ottJ3vSZOOzDl3c4Yx3Vk=; b=JfJ4BPFkaVNDewhJh0VbGnxK3NuPIOxL8g0psOotd8UHHzQTVNAQq8HMrH/5y0+9NoNbE4 R3UXw2tNvO2MUtqeT+p55A5Z4IuBE3ckQnvQ70F7DbCoHp+SGJVbjtm1xhc11GKqsmB83u h+W+Vb7SB60Cl+CNJ4qtEuo2glgL/mU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344918; 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=BjlbIXI20cfQeOQ/SCIWC1ottJ3vSZOOzDl3c4Yx3Vk=; b=9vCXGmZvisxYSmVFr7jfKLVeQirGEhMBDVxhs91kdhp8MJy7BTeYPYWGOXlrNweOV30RnJ JWf1Pp5Zm3TLIgAg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=JfJ4BPFk; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=9vCXGmZv DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344918; 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=BjlbIXI20cfQeOQ/SCIWC1ottJ3vSZOOzDl3c4Yx3Vk=; b=JfJ4BPFkaVNDewhJh0VbGnxK3NuPIOxL8g0psOotd8UHHzQTVNAQq8HMrH/5y0+9NoNbE4 R3UXw2tNvO2MUtqeT+p55A5Z4IuBE3ckQnvQ70F7DbCoHp+SGJVbjtm1xhc11GKqsmB83u h+W+Vb7SB60Cl+CNJ4qtEuo2glgL/mU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344918; 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=BjlbIXI20cfQeOQ/SCIWC1ottJ3vSZOOzDl3c4Yx3Vk=; b=9vCXGmZvisxYSmVFr7jfKLVeQirGEhMBDVxhs91kdhp8MJy7BTeYPYWGOXlrNweOV30RnJ JWf1Pp5Zm3TLIgAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 18/32] migration/colo: Send device states without copying buffer Date: Tue, 17 Feb 2026 13:14:29 -0300 Message-ID: <20260217161443.12738-19-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: C962E5BCEA 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: 1771345212661158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu We can safely use the async version of put buffer here because the qemufile will be flushed right away. Suggested-by: Fabiano Rosas Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-13-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/colo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/colo.c b/migration/colo.c index 1b94e0f0ee..0b1a58cd8f 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -486,7 +486,8 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, goto out; } =20 - qemu_put_buffer(s->to_dst_file, bioc->data, bioc->usage); + /* We can use async put because flush happens right away */ + qemu_put_buffer_async(s->to_dst_file, bioc->data, bioc->usage, false); ret =3D qemu_fflush(s->to_dst_file); if (ret < 0) { goto out; --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344999; cv=none; d=zohomail.com; s=zohoarc; b=ZjFf/EacuSaV381WZyhTqP4EXFleVAlZ3dPs2C1rHOIHghrD7e9MNBuUzWfU8kEOJv4GwaRldLaie/DmcpBihGU67roSPMtMyzQxgKcw+Mj0wEuLvWY6GjRb0aXTKsceWIwxFb6SE47oYjxeDT0VCC95/CpEQw98i8C8HXJ0t04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344999; 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=7WBuHXqVW46mjO6PApAR2x1nlI/zWNGwf5+rqN91fS0=; b=XRknyqR9tVv6J3C14oIUcz6W6LTL2ZjoRdG7X6IgEo56Ewt45Slmw7/3CTCGmh1esamN2XkyHdmkyqlFu8587CZCqgskfRWrJ6H3AY9k24afLeq3AZPXIcNIT/ztIr5+SAb8igGsD+tq1yM+kURvSgTR8OygjP4+ZotBfrvPfcg= 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 177134499929186.65188117630464; Tue, 17 Feb 2026 08:16:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNk4-0002GL-Gs; Tue, 17 Feb 2026 11:16:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNjw-0001cV-2F for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:57 -0500 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 1vsNjt-0003CL-Pb for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:15:55 -0500 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 727015BCF6; Tue, 17 Feb 2026 16:15:20 +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 392083EA66; Tue, 17 Feb 2026 16:15:18 +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 wIGMOxaUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344920; 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=7WBuHXqVW46mjO6PApAR2x1nlI/zWNGwf5+rqN91fS0=; b=bFEqEmEDv5Td8+ou7fL5YnhIcSoQ2u40UYADjxRUDE2ZjOzRPVcJsXC7oL9Ix4YLJJE4IZ oSg900f02VaIdStyHED/7c6Mylb0RlvsdFvEY0bSEhE18YvAOKQeCDYdWrxnasIteXiJHE W1kpkIc+xpQVS+h0kxtmK1S93XyeYJA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344920; 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=7WBuHXqVW46mjO6PApAR2x1nlI/zWNGwf5+rqN91fS0=; b=+b9qajxkWkjc6r2ezdtJNanf3axE3LV3L30pOK0ruHK7mMviyxiHGY8p26Q2f3AdjS0AWs VRnHkeGPL2UUjBCw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=bFEqEmED; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=+b9qajxk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344920; 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=7WBuHXqVW46mjO6PApAR2x1nlI/zWNGwf5+rqN91fS0=; b=bFEqEmEDv5Td8+ou7fL5YnhIcSoQ2u40UYADjxRUDE2ZjOzRPVcJsXC7oL9Ix4YLJJE4IZ oSg900f02VaIdStyHED/7c6Mylb0RlvsdFvEY0bSEhE18YvAOKQeCDYdWrxnasIteXiJHE W1kpkIc+xpQVS+h0kxtmK1S93XyeYJA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344920; 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=7WBuHXqVW46mjO6PApAR2x1nlI/zWNGwf5+rqN91fS0=; b=+b9qajxkWkjc6r2ezdtJNanf3axE3LV3L30pOK0ruHK7mMviyxiHGY8p26Q2f3AdjS0AWs VRnHkeGPL2UUjBCw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 19/32] migration/postcopy: Send device states without copying buffer Date: Tue, 17 Feb 2026 13:14:30 -0300 Message-ID: <20260217161443.12738-20-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim,suse.de:mid,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; 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]; RCPT_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 727015BCF6 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345001833154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Put buffer can be async as long as the flush happens before the buffer will be recycled / reused. Do it for postcopy package data. Quick measurement shows a small VM the time to push / flush the package shrinks from 91us to 38us. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-14-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/savevm.c b/migration/savevm.c index 9d2109718a..d41e89228d 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1136,7 +1136,8 @@ int qemu_savevm_send_packaged(QEMUFile *f, const uint= 8_t *buf, size_t len) trace_qemu_savevm_send_packaged(); qemu_savevm_command_send(f, MIG_CMD_PACKAGED, 4, (uint8_t *)&tmp); =20 - qemu_put_buffer(f, buf, len); + /* We can use async put because the qemufile will be flushed right awa= y */ + qemu_put_buffer_async(f, buf, len, false); qemu_fflush(f); =20 return 0; --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345250; cv=none; d=zohomail.com; s=zohoarc; b=JoOiTGMviSdtopn0NJWslAIiV91cTnhUIQLMO7zEugdeTmy0dq3Dm4OyY4oLCnwYARYoOApyr/VzA4wLQosTo6jTf8BvOchvFYojOQUeZP+C8zrxeyq4HzEngwdJ9b5aJ3Sjg02qBXidoY5yJNs7BYWWYVYpBhSaEqX+ptfNtMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345250; 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=Cp1/L9VLv4rwmbtSW57Mya9oHqi4a5jOhw+l/VFHbiE=; b=jHPNpDI2Acr7cZ4Yl3vfveAGnr0nRL0xvgQ/YsM8Do1Cw8uzMkq5ByZPEOYEyy5x+w2TpPnKebBnrXeF/mdJAu2CBBHIr5ocQawAwoZ5mJQr/uk0qZbezCYECou1jjS5psTsgAHlrMskModFDNhSxnwcMq9isTo0gF0JT0OIEYE= 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 1771345250379719.3945603323343; Tue, 17 Feb 2026 08:20:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNk5-0002Nz-IA; Tue, 17 Feb 2026 11:16:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNk2-00021o-My for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:02 -0500 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 1vsNjz-0003D6-Ez for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:02 -0500 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 1B6545BCFD; Tue, 17 Feb 2026 16:15:22 +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 D5ED13EA66; Tue, 17 Feb 2026 16:15:20 +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 UJFIJhiUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344922; 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=Cp1/L9VLv4rwmbtSW57Mya9oHqi4a5jOhw+l/VFHbiE=; b=VYUC/s84tUOtW/O9BOny8MYlrBeBknI4Y/Q/2wbFXMKQLj++B1sVPww0ZOICL7G7k6UslC 8VWlIXNTbanjqa2kLH8a4wKxjyXrFj5B8xy/oQXq0F9hCou4OYCFnIwoUBtI2b6U9ZlKrX s6eePPZ1yzKGBpcLErIg+Y1efuTY+zM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344922; 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=Cp1/L9VLv4rwmbtSW57Mya9oHqi4a5jOhw+l/VFHbiE=; b=XIglfEJNxbFDPVpizqFngSD9e1Hn8yFJ/Z/x1m5ZxUftl6RFR/inrdo/ipBmQjr4zFHymU 8RASO1a5TuiiF7DA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344922; 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=Cp1/L9VLv4rwmbtSW57Mya9oHqi4a5jOhw+l/VFHbiE=; b=VYUC/s84tUOtW/O9BOny8MYlrBeBknI4Y/Q/2wbFXMKQLj++B1sVPww0ZOICL7G7k6UslC 8VWlIXNTbanjqa2kLH8a4wKxjyXrFj5B8xy/oQXq0F9hCou4OYCFnIwoUBtI2b6U9ZlKrX s6eePPZ1yzKGBpcLErIg+Y1efuTY+zM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344922; 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=Cp1/L9VLv4rwmbtSW57Mya9oHqi4a5jOhw+l/VFHbiE=; b=XIglfEJNxbFDPVpizqFngSD9e1Hn8yFJ/Z/x1m5ZxUftl6RFR/inrdo/ipBmQjr4zFHymU 8RASO1a5TuiiF7DA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 20/32] migration: Introduce qemu_savevm_state_end() Date: Tue, 17 Feb 2026 13:14:31 -0300 Message-ID: <20260217161443.12738-21-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345250923158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu Introduce a helper to end a migration stream. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-15-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/colo.c | 2 +- migration/savevm.c | 12 +++++++++--- migration/savevm.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 0b1a58cd8f..db804b25a9 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -470,7 +470,7 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, * to be blocked here. */ qemu_savevm_state_complete_precopy_iterable(s->to_dst_file, false); - qemu_put_byte(s->to_dst_file, QEMU_VM_EOF); + qemu_savevm_state_end(s->to_dst_file); =20 /* * We need the size of the VMstate data in Secondary side, diff --git a/migration/savevm.c b/migration/savevm.c index d41e89228d..a787691352 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1065,6 +1065,12 @@ static int vmstate_save(QEMUFile *f, SaveStateEntry = *se, JSONWriter *vmdesc, } return 0; } + +void qemu_savevm_state_end(QEMUFile *f) +{ + qemu_put_byte(f, QEMU_VM_EOF); +} + /** * qemu_savevm_command_send: Send a 'QEMU_VM_COMMAND' type element with the * command and associated data. @@ -1555,7 +1561,7 @@ void qemu_savevm_state_complete_postcopy(QEMUFile *f) } } =20 - qemu_put_byte(f, QEMU_VM_EOF); + qemu_savevm_state_end(f); qemu_fflush(f); } =20 @@ -1699,7 +1705,7 @@ int qemu_savevm_state_complete_precopy_non_iterable(Q= EMUFile *f, =20 if (!in_postcopy) { /* Postcopy stream will still be going */ - qemu_put_byte(f, QEMU_VM_EOF); + qemu_savevm_state_end(f); =20 if (vmdesc) { json_writer_end_array(vmdesc); @@ -1879,7 +1885,7 @@ int qemu_save_device_state(QEMUFile *f) } } =20 - qemu_put_byte(f, QEMU_VM_EOF); + qemu_savevm_state_end(f); =20 return qemu_file_get_error(f); } diff --git a/migration/savevm.h b/migration/savevm.h index ea01ca63ec..d0596d1d62 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -49,6 +49,7 @@ void qemu_savevm_state_pending_estimate(uint64_t *must_pr= ecopy, uint64_t *can_postcopy); int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postc= opy); bool qemu_savevm_state_postcopy_prepare(QEMUFile *f, Error **errp); +void qemu_savevm_state_end(QEMUFile *f); void qemu_savevm_send_ping(QEMUFile *f, uint32_t value); void qemu_savevm_send_open_return_path(QEMUFile *f); int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345014; cv=none; d=zohomail.com; s=zohoarc; b=ccBEHabTJ5fSMAdcCAy7rf2Z8Nbb0NDKuxpv+uZtO9KRFItM/+oFVMaG+NXPoSmMPCz2Qvxk2x74XZNUaPTNB4eDU8qEUA5Hbkk7mXbH0NG8lOIis9IPs/AlDmYDDVqpLSrD30vXtmRr4/vQqT6CB2TDqQQtnI14bGTf0c5rNlM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345014; 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=RvjkXicWg7mcQymLhYRs9gixGffnoQaRnIA4ig3ETSo=; b=mugnGI4RdBhN4rDthbHMXIruWZHdaX0IiFKFVaoAkCKXGkJI+G/RTUs34XnN8QeOH27Zg90KPshcr0VrmsrMWuzpLem2qnOi6cUnJLS9xegt7dCxPyatd8BgAzW0Szx++cG95jMQ9VlukARW6NIG3if84xtvmY+oGlB2GemvwDo= 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 1771345014883280.7394107112882; Tue, 17 Feb 2026 08:16:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNk2-00020y-ON; Tue, 17 Feb 2026 11:16:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNk1-0001pv-DT for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:01 -0500 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 1vsNjy-0003D0-T8 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:01 -0500 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 B6BF33E6C2; Tue, 17 Feb 2026 16:15:23 +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 7DB023EA66; Tue, 17 Feb 2026 16:15:22 +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 6AfDEBqUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344923; 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=RvjkXicWg7mcQymLhYRs9gixGffnoQaRnIA4ig3ETSo=; b=NKfTG4isU4LCcCmE3weNC+a7mcbPf8BXZn2QH2P579g1s1OP3GIPMH4K/XW8QT2hniUcP3 vnVYz9IjJzBwNAJKAqPD26GoE7wXz7dkORqEf6AEFsWtFZWx4FNSQfSmxYCJupvHWo3iNB Oa2nMcdkyBj87/sA51MvoliBBb56wN0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344923; 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=RvjkXicWg7mcQymLhYRs9gixGffnoQaRnIA4ig3ETSo=; b=86RscKz5J+ZKXV99bPmzVLPiD1tiOJGMXkMpfMiK1XWlqxTythKWTFgiE6qT/usl4Dk64g b05ClKSDte1ouGAg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=NKfTG4is; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=86RscKz5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344923; 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=RvjkXicWg7mcQymLhYRs9gixGffnoQaRnIA4ig3ETSo=; b=NKfTG4isU4LCcCmE3weNC+a7mcbPf8BXZn2QH2P579g1s1OP3GIPMH4K/XW8QT2hniUcP3 vnVYz9IjJzBwNAJKAqPD26GoE7wXz7dkORqEf6AEFsWtFZWx4FNSQfSmxYCJupvHWo3iNB Oa2nMcdkyBj87/sA51MvoliBBb56wN0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344923; 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=RvjkXicWg7mcQymLhYRs9gixGffnoQaRnIA4ig3ETSo=; b=86RscKz5J+ZKXV99bPmzVLPiD1tiOJGMXkMpfMiK1XWlqxTythKWTFgiE6qT/usl4Dk64g b05ClKSDte1ouGAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 21/32] migration: Provide helper for save vm description Date: Tue, 17 Feb 2026 13:14:32 -0300 Message-ID: <20260217161443.12738-22-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; 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]; R_RATELIMIT(0.00)[to_ip_from(RLi3368pnyb3ujpcs6u1hud8b3)]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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: B6BF33E6C2 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: 1771345018094154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Provide two smaller helpers to dump the vm desc. Preparing to move it out and generalize device state dump. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-16-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 35 +++++++++++++++++++++++------------ migration/savevm.h | 1 + 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index a787691352..41560b97a4 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1669,13 +1669,34 @@ ret_fail_abort_threads: return -1; } =20 +static void qemu_savevm_state_vm_desc(MigrationState *s, QEMUFile *f) +{ + JSONWriter *vmdesc =3D s->vmdesc; + int vmdesc_len; + + if (vmdesc) { + json_writer_end_array(vmdesc); + json_writer_end_object(vmdesc); + vmdesc_len =3D strlen(json_writer_get(vmdesc)); + + qemu_put_byte(f, QEMU_VM_VMDESCRIPTION); + qemu_put_be32(f, vmdesc_len); + qemu_put_buffer(f, (uint8_t *)json_writer_get(vmdesc), vmdesc_len); + } +} + +void qemu_savevm_state_end_precopy(MigrationState *s, QEMUFile *f) +{ + qemu_savevm_state_end(f); + qemu_savevm_state_vm_desc(s, f); +} + int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f, bool in_postcopy) { MigrationState *ms =3D migrate_get_current(); int64_t start_ts_each, end_ts_each; JSONWriter *vmdesc =3D ms->vmdesc; - int vmdesc_len; SaveStateEntry *se; Error *local_err =3D NULL; int ret; @@ -1705,17 +1726,7 @@ int qemu_savevm_state_complete_precopy_non_iterable(= QEMUFile *f, =20 if (!in_postcopy) { /* Postcopy stream will still be going */ - qemu_savevm_state_end(f); - - if (vmdesc) { - json_writer_end_array(vmdesc); - json_writer_end_object(vmdesc); - vmdesc_len =3D strlen(json_writer_get(vmdesc)); - - qemu_put_byte(f, QEMU_VM_VMDESCRIPTION); - qemu_put_be32(f, vmdesc_len); - qemu_put_buffer(f, (uint8_t *)json_writer_get(vmdesc), vmdesc_= len); - } + qemu_savevm_state_end_precopy(ms, f); } =20 trace_vmstate_downtime_checkpoint("src-non-iterable-saved"); diff --git a/migration/savevm.h b/migration/savevm.h index d0596d1d62..f957f851ef 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -50,6 +50,7 @@ void qemu_savevm_state_pending_estimate(uint64_t *must_pr= ecopy, int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postc= opy); bool qemu_savevm_state_postcopy_prepare(QEMUFile *f, Error **errp); void qemu_savevm_state_end(QEMUFile *f); +void qemu_savevm_state_end_precopy(MigrationState *s, QEMUFile *f); void qemu_savevm_send_ping(QEMUFile *f, uint32_t value); void qemu_savevm_send_open_return_path(QEMUFile *f); int qemu_savevm_send_packaged(QEMUFile *f, const uint8_t *buf, size_t len); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345088; cv=none; d=zohomail.com; s=zohoarc; b=Kv9EFp8+/WbfDTOKVbZlRaBTPNv/7AGJKmJMAbvJ/CefrqOr+L8Y+peiXo+cH7bk32Cvc8QgwfHmddScUX8MXHROgq0KcXj/7va44xrZqYkijyjU0zaqoO/47roOhfBZF4ikNTw5+d7kfxWSJM6O1g8PpqI0yL6wTA2SysxtmP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345088; 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=ecyzQFW+bvF4ZS7tAIDWyJAD7Cb1x9QE6A75KawzHrY=; b=fQ+eY7Yt9xOvPcw3grb9uGNn1HI+98eiMdpjJL9uSr7nP+Hz1980ndupzjip0oGPbubebdOM7D/1eDRU0KAhvqAeiL+NYjY/OCslHOBslZtQDs7yPOZUyTESCzF2oJHfV3/VqQAduLSNHx9XfYT84u38tDf/ch6OK0tmmhDGahI= 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 1771345088351858.6637504120563; Tue, 17 Feb 2026 08:18:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkC-0002yh-M6; Tue, 17 Feb 2026 11:16:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNk8-0002kn-HI for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:08 -0500 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 1vsNk6-0003EF-4s for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:08 -0500 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 5EC255BCE9; Tue, 17 Feb 2026 16:15:25 +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 26DE63EA66; Tue, 17 Feb 2026 16:15:23 +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 mCIxNxuUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344925; 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=ecyzQFW+bvF4ZS7tAIDWyJAD7Cb1x9QE6A75KawzHrY=; b=W31zP6Dl4r7cgLH1HOU68Kczcp3iBfYEr25q+irmW51myJaa6wjMD7j/TP0oHYcD+HUwHr vB+vg+4geWJyUp0nzauglOj5bkj6g7FFV1MH32rDKSujHPGOUGRWW7aswpSb/0qU5mUkSJ PHRShfoxdMEwwOpSW2aId6I9asqns9I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344925; 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=ecyzQFW+bvF4ZS7tAIDWyJAD7Cb1x9QE6A75KawzHrY=; b=hg9Gp2eJ8DDPmw1/VH2ZR7r/jKqmUEWARIUh4aK7eRjpQpjVXdoXS3Pp3kO1GVE6Viaih/ 9nLbyYDz9x3QqADQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344925; 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=ecyzQFW+bvF4ZS7tAIDWyJAD7Cb1x9QE6A75KawzHrY=; b=W31zP6Dl4r7cgLH1HOU68Kczcp3iBfYEr25q+irmW51myJaa6wjMD7j/TP0oHYcD+HUwHr vB+vg+4geWJyUp0nzauglOj5bkj6g7FFV1MH32rDKSujHPGOUGRWW7aswpSb/0qU5mUkSJ PHRShfoxdMEwwOpSW2aId6I9asqns9I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344925; 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=ecyzQFW+bvF4ZS7tAIDWyJAD7Cb1x9QE6A75KawzHrY=; b=hg9Gp2eJ8DDPmw1/VH2ZR7r/jKqmUEWARIUh4aK7eRjpQpjVXdoXS3Pp3kO1GVE6Viaih/ 9nLbyYDz9x3QqADQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 22/32] migration: Split qemu_savevm_state_complete_precopy_non_iterable() Date: Tue, 17 Feb 2026 13:14:33 -0300 Message-ID: <20260217161443.12738-23-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: 1771345089428154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Split the function, making itself to be the helper to dump all non-iterable device states (early_vmsd excluded). Move the precopy end logic out to the two callers that need it. With it, we can remove the in_postcopy parameter. Meanwhile, renaming the function to be qemu_savevm_state_non_iterable(): we don't need the keyword "complete" because non-iterable doesn't iterate anyway, and we don't need precopy because we moved precopy specialties out. NOTE: this patch introduced one new migrate_get_current() user; will be removed in follow up patch. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-17-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 7 +++++-- migration/savevm.c | 12 ++++-------- migration/savevm.h | 3 +-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b7a2eee25c..b1d421953f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2552,7 +2552,7 @@ static int postcopy_start(MigrationState *ms, Error *= *errp) */ qemu_savevm_send_postcopy_listen(fb); =20 - ret =3D qemu_savevm_state_complete_precopy_non_iterable(fb, true); + ret =3D qemu_savevm_state_non_iterable(fb); if (ret) { error_setg(errp, "Postcopy save non-iterable device states failed"= ); goto fail_closefb; @@ -3690,9 +3690,12 @@ static void *bg_migration_thread(void *opaque) goto fail; } =20 - if (qemu_savevm_state_complete_precopy_non_iterable(fb, false)) { + if (qemu_savevm_state_non_iterable(fb)) { goto fail; } + + qemu_savevm_state_end_precopy(s, fb); + /* * Since we are going to get non-iterable state data directly * from s->bioc->data, explicit flush is needed here. diff --git a/migration/savevm.c b/migration/savevm.c index 41560b97a4..e1918d4f38 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1691,8 +1691,7 @@ void qemu_savevm_state_end_precopy(MigrationState *s,= QEMUFile *f) qemu_savevm_state_vm_desc(s, f); } =20 -int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f, - bool in_postcopy) +int qemu_savevm_state_non_iterable(QEMUFile *f) { MigrationState *ms =3D migrate_get_current(); int64_t start_ts_each, end_ts_each; @@ -1724,11 +1723,6 @@ int qemu_savevm_state_complete_precopy_non_iterable(= QEMUFile *f, end_ts_each - start_ts_each); } =20 - if (!in_postcopy) { - /* Postcopy stream will still be going */ - qemu_savevm_state_end_precopy(ms, f); - } - trace_vmstate_downtime_checkpoint("src-non-iterable-saved"); =20 return 0; @@ -1743,11 +1737,13 @@ int qemu_savevm_state_complete_precopy(QEMUFile *f) return ret; } =20 - ret =3D qemu_savevm_state_complete_precopy_non_iterable(f, false); + ret =3D qemu_savevm_state_non_iterable(f); if (ret) { return ret; } =20 + qemu_savevm_state_end_precopy(migrate_get_current(), f); + return qemu_fflush(f); } =20 diff --git a/migration/savevm.h b/migration/savevm.h index f957f851ef..57b96133d5 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -74,8 +74,7 @@ int qemu_loadvm_state_main(QEMUFile *f, MigrationIncoming= State *mis, Error **errp); int qemu_load_device_state(QEMUFile *f, Error **errp); int qemu_loadvm_approve_switchover(void); -int qemu_savevm_state_complete_precopy_non_iterable(QEMUFile *f, - bool in_postcopy); +int qemu_savevm_state_non_iterable(QEMUFile *f); =20 bool qemu_loadvm_load_state_buffer(const char *idstr, uint32_t instance_id, char *buf, size_t len, Error **errp); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344985; cv=none; d=zohomail.com; s=zohoarc; b=E2yCZ6gHoc7HXSIr6fuOSwmOeF9XwAg64OGKfMocOJnpZNqRH5nobmVVqLd7SLi8rSeJixeDIh2M8NVfITkQla7Ip7/uiAXpnei7v9bbesx+OMuWhYQ5J5LsFpQkqJKFAn3N59lX+hjAJ4Kcnq2JQN88Rh7vZ4KkhJuXPAQ1W+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344985; 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=tK4/ttAO/SNXZmJLNh5rwp3VCdcNm1uinpaCsgNSp1M=; b=jcfyQz4PEE/UXlzDEscmKOEagMtmtLoMTNXqw6KdB7KTv3C0Tk+8bURbb9m3O6wWr8uW2oSV+n6AxlcbpdMwq+k9as6taI/uHhXSrrF0Z7/bAHv5HGOpsCpFaGAYDEbq/0KEYQSpa35QlU7Ib5hvyareoEJaHcGJwnTbSAIyicE= 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 1771344985510534.6365868622672; Tue, 17 Feb 2026 08:16:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkF-0003Jn-SE; Tue, 17 Feb 2026 11:16:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkE-0003C3-AJ for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:14 -0500 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 1vsNkC-0003F0-Cr for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:14 -0500 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 06D355BD20; Tue, 17 Feb 2026 16:15:27 +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 C36F53EA66; Tue, 17 Feb 2026 16:15:25 +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 SEbNIR2UlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344927; 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=tK4/ttAO/SNXZmJLNh5rwp3VCdcNm1uinpaCsgNSp1M=; b=JyCIBlvmOFNjDkOIF2I6UI3it+Q20HnET5vec0svinR2SKiLiCqFHAoT1zj/uaAVgOz1cu IgXl3NJnJHM3Pc2fb4aW9A2/D1Nq5QWIsElsd++XBuezsXAqcJMamek7/GCtqIHZDQI0Xe gUK4AfMEGdaz+xQMXLbcweHPibdMGxw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344927; 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=tK4/ttAO/SNXZmJLNh5rwp3VCdcNm1uinpaCsgNSp1M=; b=d50Tdt3Voby7qBiz12UY9lcF/5wr4AVh65rMfPunFmKRPnR80qaTWJHWtOXXch5WycY/5O pv/OwdU50gBchMDg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=JyCIBlvm; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=d50Tdt3V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344927; 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=tK4/ttAO/SNXZmJLNh5rwp3VCdcNm1uinpaCsgNSp1M=; b=JyCIBlvmOFNjDkOIF2I6UI3it+Q20HnET5vec0svinR2SKiLiCqFHAoT1zj/uaAVgOz1cu IgXl3NJnJHM3Pc2fb4aW9A2/D1Nq5QWIsElsd++XBuezsXAqcJMamek7/GCtqIHZDQI0Xe gUK4AfMEGdaz+xQMXLbcweHPibdMGxw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344927; 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=tK4/ttAO/SNXZmJLNh5rwp3VCdcNm1uinpaCsgNSp1M=; b=d50Tdt3Voby7qBiz12UY9lcF/5wr4AVh65rMfPunFmKRPnR80qaTWJHWtOXXch5WycY/5O pv/OwdU50gBchMDg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 23/32] migration: qemu_savevm_state_complete_precopy() take MigrationState* Date: Tue, 17 Feb 2026 13:14:34 -0300 Message-ID: <20260217161443.12738-24-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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%]; 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)[]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:dkim,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; 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]; R_RATELIMIT(0.00)[to_ip_from(RLi3368pnyb3ujpcs6u1hud8b3)]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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: 06D355BD20 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: 1771344987731158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu Make it pass in MigrationState* instead of s->to_dst_file, so as to drop the internal migrate_get_current(). Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-18-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 2 +- migration/savevm.c | 7 ++++--- migration/savevm.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b1d421953f..27e4456429 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2757,7 +2757,7 @@ static int migration_completion_precopy(MigrationStat= e *s) goto out_unlock; } =20 - ret =3D qemu_savevm_state_complete_precopy(s->to_dst_file); + ret =3D qemu_savevm_state_complete_precopy(s); out_unlock: bql_unlock(); return ret; diff --git a/migration/savevm.c b/migration/savevm.c index e1918d4f38..830d8e5988 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1728,8 +1728,9 @@ int qemu_savevm_state_non_iterable(QEMUFile *f) return 0; } =20 -int qemu_savevm_state_complete_precopy(QEMUFile *f) +int qemu_savevm_state_complete_precopy(MigrationState *s) { + QEMUFile *f =3D s->to_dst_file; int ret; =20 ret =3D qemu_savevm_state_complete_precopy_iterable(f, false); @@ -1742,7 +1743,7 @@ int qemu_savevm_state_complete_precopy(QEMUFile *f) return ret; } =20 - qemu_savevm_state_end_precopy(migrate_get_current(), f); + qemu_savevm_state_end_precopy(s, f); =20 return qemu_fflush(f); } @@ -1841,7 +1842,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) =20 ret =3D qemu_file_get_error(f); if (ret =3D=3D 0) { - qemu_savevm_state_complete_precopy(f); + qemu_savevm_state_complete_precopy(ms); ret =3D qemu_file_get_error(f); } if (ret !=3D 0) { diff --git a/migration/savevm.h b/migration/savevm.h index 57b96133d5..bded5e2a6c 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -42,7 +42,7 @@ void qemu_savevm_state_header(QEMUFile *f); int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy); void qemu_savevm_state_cleanup(void); void qemu_savevm_state_complete_postcopy(QEMUFile *f); -int qemu_savevm_state_complete_precopy(QEMUFile *f); +int qemu_savevm_state_complete_precopy(MigrationState *s); void qemu_savevm_state_pending_exact(uint64_t *must_precopy, uint64_t *can_postcopy); void qemu_savevm_state_pending_estimate(uint64_t *must_precopy, --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344988; cv=none; d=zohomail.com; s=zohoarc; b=lMFsuAkTedkxsd9AxKaBNfoJaAxp/Zz61gL1xbEfrA0DUJUwt+4bX7scG+Ub3Kpqsx9rQli60+Ri88+bB/zi9kIBELpJWH1m/RJQWByVUjZH+hRsvq8gsLBInfIBYgjoiWh4jISdbxJ+cTVqJF6tsdTicvBHvxmgZOKszH7ubVg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344988; 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=MUvhq9pWvsUhIcilKgO+n7qUAKeVHUavS5Zx0BsWpwU=; b=Tl4Yh+fLIUlff6cA+02N0qJ2mNwruLVNrPoeLegriT4GMe8a/tVNYHYkaWhr8woIi8MWzOXWdCbR8jPZ9csMABySl+h6VzV2k9xA5JKX27gdi09a9Qcb0zNq9J0WbfNeFMyt9VzMg1vWABifWyM7uRHWv+iVThAWesOhgGvvJLQ= 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 1771344988224928.1940415537867; Tue, 17 Feb 2026 08:16:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkA-0002n2-NU; Tue, 17 Feb 2026 11:16:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNk7-0002dM-2D for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:07 -0500 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 1vsNk5-0003EB-AE for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:06 -0500 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 A510A3E720; Tue, 17 Feb 2026 16:15:28 +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 6B2C93EA66; Tue, 17 Feb 2026 16:15:27 +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 CDQ6DB+UlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344928; 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=MUvhq9pWvsUhIcilKgO+n7qUAKeVHUavS5Zx0BsWpwU=; b=Ig10YHqO+JsL1PWVozZRLdJaHTN0deoLRJuv5buC16IkRdlvW9GjwDsEEolcgxL5tu3bbB x5R9apHO7ZKTx9CSQoOLsE63JgYU6nf52TzT/cOINe0JX55A7wCCSb5gIuNJvQtZ4KjJVT 7HnC0m3YTJRkB9YJbHao4+7ztIbkrHA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344928; 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=MUvhq9pWvsUhIcilKgO+n7qUAKeVHUavS5Zx0BsWpwU=; b=rhMfVgAFRDvsQ+PsVwjd3+ENUkwDDDV1EI/2d25Pr2H/jRYu1fkZAlUOoCLkejLljuTtFv qFaCbILkzujSX0Cw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Ig10YHqO; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=rhMfVgAF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344928; 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=MUvhq9pWvsUhIcilKgO+n7qUAKeVHUavS5Zx0BsWpwU=; b=Ig10YHqO+JsL1PWVozZRLdJaHTN0deoLRJuv5buC16IkRdlvW9GjwDsEEolcgxL5tu3bbB x5R9apHO7ZKTx9CSQoOLsE63JgYU6nf52TzT/cOINe0JX55A7wCCSb5gIuNJvQtZ4KjJVT 7HnC0m3YTJRkB9YJbHao4+7ztIbkrHA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344928; 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=MUvhq9pWvsUhIcilKgO+n7qUAKeVHUavS5Zx0BsWpwU=; b=rhMfVgAFRDvsQ+PsVwjd3+ENUkwDDDV1EI/2d25Pr2H/jRYu1fkZAlUOoCLkejLljuTtFv qFaCbILkzujSX0Cw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 24/32] migration: Cleanup error propagates in qemu_savevm_state_setup() Date: Tue, 17 Feb 2026 13:14:35 -0300 Message-ID: <20260217161443.12738-25-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; URIBL_BLOCKED(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; 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]; R_RATELIMIT(0.00)[to_ip_from(RLi3368pnyb3ujpcs6u1hud8b3)]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: A510A3E720 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: 1771344989582158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu We did two unnecessary error propagations in qemu_savevm_state_setup(), on either propagate it to MigrationState*, or set qemufile with error. Error propagation is not needed because: - Two live migration callers ([bg_]migration_thread) will propagate error if this function returned with an error. - Save snapshot (qemu_savevm_state) doesn't need to persist error; it got returned directly from save_snapshot(). QEMUFile set error is not needed because the callers always check for errors explicitly. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-19-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 830d8e5988..0683a103c8 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1385,8 +1385,6 @@ int qemu_savevm_state_setup(QEMUFile *f, Error **errp) if (se->vmsd && se->vmsd->early_setup) { ret =3D vmstate_save(f, se, vmdesc, errp); if (ret) { - migrate_error_propagate(ms, error_copy(*errp)); - qemu_file_set_error(f, ret); break; } continue; @@ -1405,7 +1403,6 @@ int qemu_savevm_state_setup(QEMUFile *f, Error **errp) ret =3D se->ops->save_setup(f, se->opaque, errp); save_section_footer(f, se); if (ret < 0) { - qemu_file_set_error(f, ret); break; } } --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771344984; cv=none; d=zohomail.com; s=zohoarc; b=CU/LWJNkzJTBJlpnafkufGPK7x+noLLwcTiIdCky3nLceESnOEw0MkjnYQtRabgEVIhCCfRNl6yzurrLSKhhxFNh/tIXdkjahngufKtyT6BCfx6WDVbSighajagLWMG7Dook6MmdI3emJk7xaIH2ud5l/JgpnSR6K2Vd63iwT8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771344984; 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=S3VqrKrhdN5UPnNL8q16Ourr8Cn92niRQK+xWCs/D10=; b=n5VcXDx07upZvA6a5NyTnAxn9UXukOdlIP3xB8jhI0nNoVSQohJ8QOC38eG7V6bHj7389I8KNxgPz35Jcd1sXEAnPYp0ufh8R7RJBO25llndpZLKOYi5gke4dc5ks+vUgsPeYLoHtb5Mg74AJ2qiLq1XbUp0/lvF63U5ueSMy7k= 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 1771344984737946.0729473768198; Tue, 17 Feb 2026 08:16:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkE-0003Bk-Db; Tue, 17 Feb 2026 11:16:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkC-0002zI-K3 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:12 -0500 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 1vsNkA-0003Ep-CU for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:12 -0500 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 4E1D23E725; Tue, 17 Feb 2026 16:15:30 +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 147323EA66; Tue, 17 Feb 2026 16:15:28 +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 cB6yMiCUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344930; 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=S3VqrKrhdN5UPnNL8q16Ourr8Cn92niRQK+xWCs/D10=; b=A49DJAyCNnsOP7m7aht2B0NePSLNZt/TfUpWfNeXJPo6CmaZCHb6gQJ36Hz+ao+IGGQtg+ WE6msDTSHXxHmpUr9g9QlSnANQE1o5KM8c/VgYz5H7ajJkPPGz8NLvKcqmTdkH83xpPsl+ I9z3yplpuLySOuzEoGUCUdOGMju5quk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344930; 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=S3VqrKrhdN5UPnNL8q16Ourr8Cn92niRQK+xWCs/D10=; b=9tgZ0aEObuQDHEu/w/vDLlBFlVnNpuQ0a0zeEAY1VFelaPyFd28Cks/50zRco52pyMP39a aMeI2P+w7q4wl8Cw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344930; 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=S3VqrKrhdN5UPnNL8q16Ourr8Cn92niRQK+xWCs/D10=; b=A49DJAyCNnsOP7m7aht2B0NePSLNZt/TfUpWfNeXJPo6CmaZCHb6gQJ36Hz+ao+IGGQtg+ WE6msDTSHXxHmpUr9g9QlSnANQE1o5KM8c/VgYz5H7ajJkPPGz8NLvKcqmTdkH83xpPsl+ I9z3yplpuLySOuzEoGUCUdOGMju5quk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344930; 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=S3VqrKrhdN5UPnNL8q16Ourr8Cn92niRQK+xWCs/D10=; b=9tgZ0aEObuQDHEu/w/vDLlBFlVnNpuQ0a0zeEAY1VFelaPyFd28Cks/50zRco52pyMP39a aMeI2P+w7q4wl8Cw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 25/32] migration: Refactor qemu_savevm_state_setup() Date: Tue, 17 Feb 2026 13:14:36 -0300 Message-ID: <20260217161443.12738-26-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771344985707158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu Split it into two smaller chunks: - Dump of early_setup VMSDs - Dump of save_setup() sections They're mutual exclusive, hence we can run two loops and do them sequentially. This will cause migration thread to loop one more time, but it should be fine when migration just started and only do it once. It's needed because we will need to reuse the early_vmsd helper later to deduplicate code elsewhere. QEMU almost sticks with qemu_savevm_state_XXX() to represent the dump of vmstates's section XXX. With that in mind, this patch renamed the original qemu_savevm_state_setup() to qemu_savevm_state_do_setup() instead. So after this patch: - qemu_savevm_state_non_iterable_early() dumps early_vmsds only, - qemu_savevm_state_setup() dumps save_setup() sections only, - qemu_savevm_state_do_setup() does all things needed during setup phase (including migration SETUP notifies) Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-20-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 4 ++-- migration/savevm.c | 56 ++++++++++++++++++++++++++++++------------- migration/savevm.h | 6 +++-- 3 files changed, 46 insertions(+), 20 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 27e4456429..f81ac21d4e 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3540,7 +3540,7 @@ static void *migration_thread(void *opaque) } =20 bql_lock(); - ret =3D qemu_savevm_state_setup(s->to_dst_file, &local_err); + ret =3D qemu_savevm_state_do_setup(s->to_dst_file, &local_err); bql_unlock(); =20 qemu_savevm_wait_unplug(s, MIGRATION_STATUS_SETUP, @@ -3663,7 +3663,7 @@ static void *bg_migration_thread(void *opaque) =20 bql_lock(); qemu_savevm_state_header(s->to_dst_file); - ret =3D qemu_savevm_state_setup(s->to_dst_file, &local_err); + ret =3D qemu_savevm_state_do_setup(s->to_dst_file, &local_err); bql_unlock(); =20 qemu_savevm_wait_unplug(s, MIGRATION_STATUS_SETUP, diff --git a/migration/savevm.c b/migration/savevm.c index 0683a103c8..b04a21ffc9 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1367,29 +1367,33 @@ int qemu_savevm_state_prepare(Error **errp) return 0; } =20 -int qemu_savevm_state_setup(QEMUFile *f, Error **errp) +int qemu_savevm_state_non_iterable_early(QEMUFile *f, + JSONWriter *vmdesc, + Error **errp) { - ERRP_GUARD(); - MigrationState *ms =3D migrate_get_current(); - JSONWriter *vmdesc =3D ms->vmdesc; SaveStateEntry *se; - int ret =3D 0; + int ret; =20 - if (vmdesc) { - json_writer_int64(vmdesc, "page_size", qemu_target_page_size()); - json_writer_start_array(vmdesc, "devices"); - } - - trace_savevm_state_setup(); QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (se->vmsd && se->vmsd->early_setup) { ret =3D vmstate_save(f, se, vmdesc, errp); if (ret) { - break; + return ret; } - continue; } + } =20 + return 0; +} + +static int qemu_savevm_state_setup(QEMUFile *f, Error **errp) +{ + SaveStateEntry *se; + int ret; + + trace_savevm_state_setup(); + + QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (!se->ops || !se->ops->save_setup) { continue; } @@ -1399,14 +1403,34 @@ int qemu_savevm_state_setup(QEMUFile *f, Error **er= rp) } } save_section_header(f, se, QEMU_VM_SECTION_START); - ret =3D se->ops->save_setup(f, se->opaque, errp); save_section_footer(f, se); if (ret < 0) { - break; + return ret; } } =20 + return 0; +} + +int qemu_savevm_state_do_setup(QEMUFile *f, Error **errp) +{ + ERRP_GUARD(); + MigrationState *ms =3D migrate_get_current(); + JSONWriter *vmdesc =3D ms->vmdesc; + int ret; + + if (vmdesc) { + json_writer_int64(vmdesc, "page_size", qemu_target_page_size()); + json_writer_start_array(vmdesc, "devices"); + } + + ret =3D qemu_savevm_state_non_iterable_early(f, vmdesc, errp); + if (ret) { + return ret; + } + + ret =3D qemu_savevm_state_setup(f, errp); if (ret) { return ret; } @@ -1826,7 +1850,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) ms->to_dst_file =3D f; =20 qemu_savevm_state_header(f); - ret =3D qemu_savevm_state_setup(f, errp); + ret =3D qemu_savevm_state_do_setup(f, errp); if (ret) { goto cleanup; } diff --git a/migration/savevm.h b/migration/savevm.h index bded5e2a6c..f2750eca09 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -34,7 +34,7 @@ bool qemu_savevm_state_blocked(Error **errp); void qemu_savevm_non_migratable_list(strList **reasons); int qemu_savevm_state_prepare(Error **errp); -int qemu_savevm_state_setup(QEMUFile *f, Error **errp); +int qemu_savevm_state_do_setup(QEMUFile *f, Error **errp); bool qemu_savevm_state_guest_unplug_pending(void); int qemu_savevm_state_resume_prepare(MigrationState *s); void qemu_savevm_send_header(QEMUFile *f); @@ -75,7 +75,9 @@ int qemu_loadvm_state_main(QEMUFile *f, MigrationIncoming= State *mis, int qemu_load_device_state(QEMUFile *f, Error **errp); int qemu_loadvm_approve_switchover(void); int qemu_savevm_state_non_iterable(QEMUFile *f); - +int qemu_savevm_state_non_iterable_early(QEMUFile *f, + JSONWriter *vmdesc, + Error **errp); bool qemu_loadvm_load_state_buffer(const char *idstr, uint32_t instance_id, char *buf, size_t len, Error **errp); =20 --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345049; cv=none; d=zohomail.com; s=zohoarc; b=e035qhjf8JG2O5GaIfMPSMxMZEl9UqeCxr+6+HJva5CUiM0JSMjjT5xaeryLo67td7JGIBuBilNyIIc0oM79IenMGRtyxgdJbuByiny5kDs/ThJIyQJj4NLZWlK6CqLKATdjZH9xwQ8LHCXbF8F+9PCm83YxbX3KZou8NFk6LJQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345049; 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=VzX5L2b6gO/RFzY6i/QF0cqQuB1sCad9BY77Dg2YtbM=; b=l9y+fRVETv0FezQn5AQVCP2F2qDSu+2vhaS6zafTb3fGsmrLhPqJSWAiowxi/OrQzg7nm0PO9qjlMknDCsG6TliFq+yYTHYuRrQurNVqUVSxQ3ZInNcA3D8vrRalyGaryiCU58uFIc0Np0lqr4rKA7V1YHtDZ0QstKMONlwB5CI= 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 1771345049038137.52919354101277; Tue, 17 Feb 2026 08:17:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkM-0003gS-GJ; Tue, 17 Feb 2026 11:16:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkK-0003Z7-79 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:20 -0500 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 1vsNkI-0003FW-3e for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:19 -0500 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 EC8DB5BD26; Tue, 17 Feb 2026 16:15:31 +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 B22C33EA66; Tue, 17 Feb 2026 16:15:30 +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 aDONHSKUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344932; 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=VzX5L2b6gO/RFzY6i/QF0cqQuB1sCad9BY77Dg2YtbM=; b=CNSTbyFJDZ0jR6KlyZEoll/u/f7oGb/aQURpu9twe/ExDwQmfAw3iS44rhv8b0C+PnMys/ L65ywm6IP2zfnDG316yK8Jhxz8Uwq2MryJaNmwwEgDv0FETktlh+SIhmb3387MxfnYVLMb +/FWDZo8RKaDpFgbAS9dSmylO7LWprY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344932; 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=VzX5L2b6gO/RFzY6i/QF0cqQuB1sCad9BY77Dg2YtbM=; b=drFJAm00Lgs9s/JLEViAjxntsA9mr5TKZWCgMNEpOZC+GxkwHdZTx5mx848WQnVe0vpxbv 7C+mnSqLI/fzemDA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344931; 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=VzX5L2b6gO/RFzY6i/QF0cqQuB1sCad9BY77Dg2YtbM=; b=hpbkW9cwcMyvc2R4qLCOM0MSQl4yVZOkgBOp+W3ACqpXowcMM5LSNgo3Ad+3Ugcdsq5XBK yNzHa8WvDDXzedb9ogj3v2WcgUncrkGFZCE4NatboqPleiMVqXMhLdypLi5mlPWamymA1p EJIFIHBkE3sxKIEnsX4UnQ2IL70fDR0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344931; 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=VzX5L2b6gO/RFzY6i/QF0cqQuB1sCad9BY77Dg2YtbM=; b=JlEqoFUKh5zuN0YgwPkTrV9wbyKEf/EOcPzOYjfHhNIoxH2XI5IjkapMny5OFVoP45pGs7 Lg2OCaTT9qmcqZAQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 26/32] migration: Introduce qemu_savevm_state_active() Date: Tue, 17 Feb 2026 13:14:37 -0300 Message-ID: <20260217161443.12738-27-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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=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) (identity @suse.de) X-ZM-MESSAGEID: 1771345049840158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu Introduce this helper to detect if a SaveStateEntry is active. Note that this helper can actually also be used in loadvm paths, but let's stick with this name for now because we still use SaveStateEntry for the shared structure that both savevm/loadvm uses, where this name still suites. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-21-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/savevm.c | 63 ++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 36 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index b04a21ffc9..c16951b532 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1071,6 +1071,16 @@ void qemu_savevm_state_end(QEMUFile *f) qemu_put_byte(f, QEMU_VM_EOF); } =20 +static inline bool qemu_savevm_state_active(SaveStateEntry *se) +{ + /* When no is_active() hook, always treat it as ACTIVE */ + if (!se->ops->is_active) { + return true; + } + + return se->ops->is_active(se->opaque); +} + /** * qemu_savevm_command_send: Send a 'QEMU_VM_COMMAND' type element with the * command and associated data. @@ -1352,12 +1362,9 @@ int qemu_savevm_state_prepare(Error **errp) if (!se->ops || !se->ops->save_prepare) { continue; } - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (!qemu_savevm_state_active(se)) { + continue; } - ret =3D se->ops->save_prepare(se->opaque, errp); if (ret < 0) { return ret; @@ -1397,10 +1404,8 @@ static int qemu_savevm_state_setup(QEMUFile *f, Erro= r **errp) if (!se->ops || !se->ops->save_setup) { continue; } - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (!qemu_savevm_state_active(se)) { + continue; } save_section_header(f, se, QEMU_VM_SECTION_START); ret =3D se->ops->save_setup(f, se->opaque, errp); @@ -1450,10 +1455,8 @@ int qemu_savevm_state_resume_prepare(MigrationState = *s) if (!se->ops || !se->ops->resume_prepare) { continue; } - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (!qemu_savevm_state_active(se)) { + continue; } ret =3D se->ops->resume_prepare(s, se->opaque); if (ret < 0) { @@ -1481,8 +1484,7 @@ int qemu_savevm_state_iterate(QEMUFile *f, bool postc= opy) if (!se->ops || !se->ops->save_live_iterate) { continue; } - if (se->ops->is_active && - !se->ops->is_active(se->opaque)) { + if (!qemu_savevm_state_active(se)) { continue; } if (se->ops->is_active_iterate && @@ -1543,10 +1545,8 @@ static int qemu_savevm_complete(SaveStateEntry *se, = QEMUFile *f) { int ret; =20 - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - return 0; - } + if (!qemu_savevm_state_active(se)) { + return 0; } =20 trace_savevm_section_start(se->idstr, se->section_id); @@ -1596,10 +1596,8 @@ bool qemu_savevm_state_postcopy_prepare(QEMUFile *f,= Error **errp) continue; } =20 - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (!qemu_savevm_state_active(se)) { + continue; } =20 trace_savevm_section_start(se->idstr, se->section_id); @@ -1785,10 +1783,8 @@ void qemu_savevm_state_pending_estimate(uint64_t *mu= st_precopy, if (!se->ops || !se->ops->state_pending_estimate) { continue; } - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (!qemu_savevm_state_active(se)) { + continue; } se->ops->state_pending_estimate(se->opaque, must_precopy, can_post= copy); } @@ -1806,10 +1802,8 @@ void qemu_savevm_state_pending_exact(uint64_t *must_= precopy, if (!se->ops || !se->ops->state_pending_exact) { continue; } - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (!qemu_savevm_state_active(se)) { + continue; } se->ops->state_pending_exact(se->opaque, must_precopy, can_postcop= y); } @@ -2829,12 +2823,9 @@ static int qemu_loadvm_state_setup(QEMUFile *f, Erro= r **errp) if (!se->ops || !se->ops->load_setup) { continue; } - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } + if (!qemu_savevm_state_active(se)) { + continue; } - ret =3D se->ops->load_setup(f, se->opaque, errp); if (ret < 0) { error_prepend(errp, "Load state of device %s failed: ", --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345023; cv=none; d=zohomail.com; s=zohoarc; b=mnwjT9FWdYyo6eC3z/NNDtbQQPnAPUvQxcM5fyGYBQwjZtPKTA4FgVzgLjEoO2RVlrYaeqEWjV7Y8Xa2FLiVQGV/+4BAbzpb+v6wzLWeiNyZacqBgiLHfwMxb7RX3GMKdRwlw6RNgdC1lnsPtZTzIWNsHcB11zIzpZarvAC2aDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345023; 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=UZ9v1zRre8MJoTcvIKPSMOTVWa31kcAX+dlQiw/brnk=; b=VtO1SOoQxXzn1D2Y1+sMyGsHHEwTKAoqi0cTwqRPZYo8yd76Wyx0A8ZrZleM7gCkWyFASAy+J9a6HaGSPEqyFxNXbgeaDRzJg7iCdc61KSh2FF0qWqH4VOdtT6TRkE1hR9PTrhifweGSoRx3ZEF4lToKUZ4Wvii2AfQqUXe2RKs= 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 1771345023724444.8437123516943; Tue, 17 Feb 2026 08:17:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkK-0003br-UO; Tue, 17 Feb 2026 11:16:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkI-0003QP-Dl for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:18 -0500 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 1vsNkG-0003FR-J6 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:18 -0500 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 946F43E718; Tue, 17 Feb 2026 16:15:33 +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 5BD833EA66; Tue, 17 Feb 2026 16:15:32 +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 OKd8CCSUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344933; 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=UZ9v1zRre8MJoTcvIKPSMOTVWa31kcAX+dlQiw/brnk=; b=xbOII4FIonnBJFJH/aCRLAKee3dF6WvtKaPxdfP07QRO7ViCy5/hm5BAqnFPLGyWGUlPSU PuWM7JZfVE67mjayVQRQmBxcdyMxS+d5qfgfbC0FyoobHNGvo3LoiN4JwGjeqVnZb6iIAl bwNNbTe8Httqdz0hGn+5cxJsSYQ+9hs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344933; 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=UZ9v1zRre8MJoTcvIKPSMOTVWa31kcAX+dlQiw/brnk=; b=kksFB/vwhJhLG7DaCbqAEEFeii/K01egg+HgH6vwyohWEsTKUILkdyUYrIuIi/94VxZ3mr pQflTMaLqsm3m+CQ== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344933; 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=UZ9v1zRre8MJoTcvIKPSMOTVWa31kcAX+dlQiw/brnk=; b=xbOII4FIonnBJFJH/aCRLAKee3dF6WvtKaPxdfP07QRO7ViCy5/hm5BAqnFPLGyWGUlPSU PuWM7JZfVE67mjayVQRQmBxcdyMxS+d5qfgfbC0FyoobHNGvo3LoiN4JwGjeqVnZb6iIAl bwNNbTe8Httqdz0hGn+5cxJsSYQ+9hs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344933; 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=UZ9v1zRre8MJoTcvIKPSMOTVWa31kcAX+dlQiw/brnk=; b=kksFB/vwhJhLG7DaCbqAEEFeii/K01egg+HgH6vwyohWEsTKUILkdyUYrIuIi/94VxZ3mr pQflTMaLqsm3m+CQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 27/32] migration/bg-snapshot: Cleanup error paths Date: Tue, 17 Feb 2026 13:14:38 -0300 Message-ID: <20260217161443.12738-28-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,web.de]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345026295154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu Cleanup bg_migration_thread() function on error handling. First of all, early_fail is almost only used to say if BQL is taken. Since we already have separate jumping labels, we don't really need it, hence removed. Also, since local_err is around, making sure every failure path will set a proper error string for the failure, then propagate to MigrationState.error. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-22-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/migration.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index f81ac21d4e..f9eec4b25a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3628,7 +3628,6 @@ static void *bg_migration_thread(void *opaque) int64_t setup_start; MigThrError thr_error; QEMUFile *fb; - bool early_fail =3D true; Error *local_err =3D NULL; int ret; =20 @@ -3674,10 +3673,7 @@ static void *bg_migration_thread(void *opaque) * devices to unplug. This to preserve migration state transitions. */ if (ret) { - migrate_error_propagate(s, local_err); - migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, - MIGRATION_STATUS_FAILED); - goto fail_setup; + goto fail; } =20 s->setup_time =3D qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; @@ -3687,11 +3683,13 @@ static void *bg_migration_thread(void *opaque) bql_lock(); =20 if (migration_stop_vm(s, RUN_STATE_PAUSED)) { - goto fail; + error_setg(&local_err, "Failed to stop the VM"); + goto fail_with_bql; } =20 if (qemu_savevm_state_non_iterable(fb)) { - goto fail; + error_setg(&local_err, "Failed to save non-iterable devices"); + goto fail_with_bql; } =20 qemu_savevm_state_end_precopy(s, fb); @@ -3704,9 +3702,9 @@ static void *bg_migration_thread(void *opaque) =20 /* Now initialize UFFD context and start tracking RAM writes */ if (ram_write_tracking_start()) { - goto fail; + error_setg(&local_err, "Failed to start write tracking"); + goto fail_with_bql; } - early_fail =3D false; =20 /* * Start VM from BH handler to avoid write-fault lock here. @@ -3738,21 +3736,22 @@ static void *bg_migration_thread(void *opaque) } =20 trace_migration_thread_after_loop(); + goto done; + +fail_with_bql: + bql_unlock(); =20 fail: - if (early_fail) { - migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, - MIGRATION_STATUS_FAILED); - bql_unlock(); - } + /* 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); =20 -fail_setup: +done: bg_migration_iteration_finish(s); - qemu_fclose(fb); object_unref(OBJECT(s)); rcu_unregister_thread(); - return NULL; } =20 --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345106; cv=none; d=zohomail.com; s=zohoarc; b=ItF2Np73nkS/V7K1iGXnmrw4oa8jGW+L1PHh1cUAeKpNdhUjmdWhom587g9LoP8LCTbxBrLYKyqt9Lru4TAY5lGcIguq/v9O6SjQS9qfoKAqOoii3p8QNrDJnd+yW4FonBrhNCJ6ayYuS+eAtInIjZh6/8W3ezhjGDpocLfjNPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345106; 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=q7zbWgwvK+X0BrdGhOjGF5ANg1JjNKZQQa6mQiQvFaE=; b=IgqOJVW5gh7d4nnQHQDUDk0vv1msyDl139sLu+cA9H6L38uoMWW96gdKd68Lfo1IY+tSf1R2teNfz57A7WYNbLVW5NPecHhhvD8neRL3HVDnsU1QiMCtMcOBixdvvFXom8I0Dy/SStt7r2P680YNrfT8GSHWnpZ828PD9po1V24= 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 1771345106084283.064497222015; Tue, 17 Feb 2026 08:18:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkP-0003rL-O9; Tue, 17 Feb 2026 11:16:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkN-0003iw-TL for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:24 -0500 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 1vsNkM-0003Ft-3o for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:23 -0500 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 3E7B73E74C; Tue, 17 Feb 2026 16:15: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 04EAD3EA66; Tue, 17 Feb 2026 16:15:33 +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 6PHiLiWUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344935; 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=q7zbWgwvK+X0BrdGhOjGF5ANg1JjNKZQQa6mQiQvFaE=; b=cvH97DpwE+WNHQtTocmeGeexoOueWneRLUldUcm3rgp+ZrwPVd46Xz7Wp1IkL2/Dxcp8y/ iXPrdia7ZyNFnRmg5EP9LU1OwaeBH7xgkI+pxAFMRDWOI1Ju7LdG8kH/ZJTz8Jb0Whmle8 f3XSuHriDLMCi7FT0PkmsoUS1wO7LXM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344935; 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=q7zbWgwvK+X0BrdGhOjGF5ANg1JjNKZQQa6mQiQvFaE=; b=CPYLc4mj3fogkk/CZmphvEwNT0Lc1A7KjOWEC+Caj08AMIF92j/9TgntTPZ+KAb2x1A255 v1viDJDPFcTjycAA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=cvH97Dpw; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=CPYLc4mj DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344935; 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=q7zbWgwvK+X0BrdGhOjGF5ANg1JjNKZQQa6mQiQvFaE=; b=cvH97DpwE+WNHQtTocmeGeexoOueWneRLUldUcm3rgp+ZrwPVd46Xz7Wp1IkL2/Dxcp8y/ iXPrdia7ZyNFnRmg5EP9LU1OwaeBH7xgkI+pxAFMRDWOI1Ju7LdG8kH/ZJTz8Jb0Whmle8 f3XSuHriDLMCi7FT0PkmsoUS1wO7LXM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344935; 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=q7zbWgwvK+X0BrdGhOjGF5ANg1JjNKZQQa6mQiQvFaE=; b=CPYLc4mj3fogkk/CZmphvEwNT0Lc1A7KjOWEC+Caj08AMIF92j/9TgntTPZ+KAb2x1A255 v1viDJDPFcTjycAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Lukas Straub Subject: [PULL 28/32] migration: Make qemu_savevm_state_non_iterable() take errp Date: Tue, 17 Feb 2026 13:14:39 -0300 Message-ID: <20260217161443.12738-29-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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%]; 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)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:mid,suse.de:dkim,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; 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]; R_RATELIMIT(0.00)[to_ip_from(RLi3368pnyb3ujpcs6u1hud8b3)]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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: 3E7B73E74C 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345108165158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu Let the function report errors to upper layers. Out of three current users, two of them already process the errors, except one outlier, qemu_savevm_state_complete_precopy(), where we do it manually for now with a comment for TODO. Signed-off-by: Peter Xu Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-23-peterx@r= edhat.com [add space in error_prepend string] Signed-off-by: Fabiano Rosas --- migration/migration.c | 8 ++++---- migration/savevm.c | 13 +++++++------ migration/savevm.h | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index f9eec4b25a..a5b0465ed3 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2552,9 +2552,9 @@ static int postcopy_start(MigrationState *ms, Error *= *errp) */ qemu_savevm_send_postcopy_listen(fb); =20 - ret =3D qemu_savevm_state_non_iterable(fb); + ret =3D qemu_savevm_state_non_iterable(fb, errp); if (ret) { - error_setg(errp, "Postcopy save non-iterable device states failed"= ); + error_prepend(errp, "Postcopy save non-iterable states failed: "); goto fail_closefb; } =20 @@ -3687,8 +3687,8 @@ static void *bg_migration_thread(void *opaque) goto fail_with_bql; } =20 - if (qemu_savevm_state_non_iterable(fb)) { - error_setg(&local_err, "Failed to save non-iterable devices"); + if (qemu_savevm_state_non_iterable(fb, &local_err)) { + error_prepend(&local_err, "Failed to save non-iterable devices "); goto fail_with_bql; } =20 diff --git a/migration/savevm.c b/migration/savevm.c index c16951b532..130b9764a7 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1710,13 +1710,12 @@ void qemu_savevm_state_end_precopy(MigrationState *= s, QEMUFile *f) qemu_savevm_state_vm_desc(s, f); } =20 -int qemu_savevm_state_non_iterable(QEMUFile *f) +int qemu_savevm_state_non_iterable(QEMUFile *f, Error **errp) { MigrationState *ms =3D migrate_get_current(); int64_t start_ts_each, end_ts_each; JSONWriter *vmdesc =3D ms->vmdesc; SaveStateEntry *se; - Error *local_err =3D NULL; int ret; =20 /* Making sure cpu states are synchronized before saving non-iterable = */ @@ -1730,10 +1729,8 @@ int qemu_savevm_state_non_iterable(QEMUFile *f) =20 start_ts_each =3D qemu_clock_get_us(QEMU_CLOCK_REALTIME); =20 - ret =3D vmstate_save(f, se, vmdesc, &local_err); + ret =3D vmstate_save(f, se, vmdesc, errp); if (ret) { - migrate_error_propagate(ms, error_copy(local_err)); - error_report_err(local_err); return ret; } =20 @@ -1750,6 +1747,7 @@ int qemu_savevm_state_non_iterable(QEMUFile *f) int qemu_savevm_state_complete_precopy(MigrationState *s) { QEMUFile *f =3D s->to_dst_file; + Error *local_err =3D NULL; int ret; =20 ret =3D qemu_savevm_state_complete_precopy_iterable(f, false); @@ -1757,8 +1755,11 @@ int qemu_savevm_state_complete_precopy(MigrationStat= e *s) return ret; } =20 - ret =3D qemu_savevm_state_non_iterable(f); + /* TODO: pass error upper */ + ret =3D qemu_savevm_state_non_iterable(f, &local_err); if (ret) { + migrate_error_propagate(s, error_copy(local_err)); + error_report_err(local_err); return ret; } =20 diff --git a/migration/savevm.h b/migration/savevm.h index f2750eca09..6a589b2990 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -74,7 +74,7 @@ int qemu_loadvm_state_main(QEMUFile *f, MigrationIncoming= State *mis, Error **errp); int qemu_load_device_state(QEMUFile *f, Error **errp); int qemu_loadvm_approve_switchover(void); -int qemu_savevm_state_non_iterable(QEMUFile *f); +int qemu_savevm_state_non_iterable(QEMUFile *f, Error **errp); int qemu_savevm_state_non_iterable_early(QEMUFile *f, JSONWriter *vmdesc, Error **errp); --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345110; cv=none; d=zohomail.com; s=zohoarc; b=PMMJsTfrH5z6SZ7Pp1TVzL+VdrlZ0kx0Zsh8f3ArH/GZVu7Mt5R0MUFi4aCRO35Oo6Kk5pWNRtCocYvecNIZEjGB5lo4U/P0Dd+8PZNbFEIsVQB43Pb9c+qMlRXTatuRBYFAp4MdGtMAQsKWphzhyV0dWjSKPjHVsjPLER7svHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345110; 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=FLDyIb6P4oWZvT3IGYsRCxpf2OohFweZuBrP+JjpjyI=; b=cURGV3fhCykr8PVRReiy0H7+jWiCPzhJHbfHGzuT81XsCxyzqEtBRPc529euxkbIKuZK8u58KHRLCRGYpNnC4uaGXSTzspBfkzLy5BF6NhKG6RPXiim7c7fXUNuklVVcyT2sGdAC6PSnJTw6O9sF3981J1N4VagItEvkIwm0gb4= 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 1771345110502642.9610473383266; Tue, 17 Feb 2026 08:18:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkR-00040W-V2; Tue, 17 Feb 2026 11:16:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkP-0003sh-Qv for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:25 -0500 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 1vsNkO-0003GC-1f for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:25 -0500 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 5CECF5BCEB; Tue, 17 Feb 2026 16:15: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 A3A6E3EA66; Tue, 17 Feb 2026 16:15:35 +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 mML0GSeUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344937; 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=FLDyIb6P4oWZvT3IGYsRCxpf2OohFweZuBrP+JjpjyI=; b=UVz+TZeLL4ZVi4RC5nk++0E82q1x5aaek+Tk/8ICO4wU7madJoTJnWEPgaeDP7cCweHdoZ RTJL9Cz5e1JhP/dt+4yhosY4BHx7PyELPgn9xF9fwBGUAGfT5Gw7gzTuBZkLQrnBmID4Fy RjH196TWo5BYCPtYOIXnDnLpGz6Jd6o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344937; 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=FLDyIb6P4oWZvT3IGYsRCxpf2OohFweZuBrP+JjpjyI=; b=9l5f7b1xJtGXIXe+JUgHa4NzbsnrldC1pNNB1qpeUeZ6Z9F4pK2gSoubUGbuZ+ZyGu6Mgk kZbtWX39QQusVDDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=UVz+TZeL; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=9l5f7b1x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344937; 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=FLDyIb6P4oWZvT3IGYsRCxpf2OohFweZuBrP+JjpjyI=; b=UVz+TZeLL4ZVi4RC5nk++0E82q1x5aaek+Tk/8ICO4wU7madJoTJnWEPgaeDP7cCweHdoZ RTJL9Cz5e1JhP/dt+4yhosY4BHx7PyELPgn9xF9fwBGUAGfT5Gw7gzTuBZkLQrnBmID4Fy RjH196TWo5BYCPtYOIXnDnLpGz6Jd6o= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344937; 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=FLDyIb6P4oWZvT3IGYsRCxpf2OohFweZuBrP+JjpjyI=; b=9l5f7b1xJtGXIXe+JUgHa4NzbsnrldC1pNNB1qpeUeZ6Z9F4pK2gSoubUGbuZ+ZyGu6Mgk kZbtWX39QQusVDDA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , David Woodhouse , Paul Durrant , Lukas Straub Subject: [PULL 29/32] migration: Simplify qemu_save_device_state() Date: Tue, 17 Feb 2026 13:14:40 -0300 Message-ID: <20260217161443.12738-30-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; URIBL_BLOCKED(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,infradead.org:email]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; 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,infradead.org:email]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; FREEMAIL_CC(0.00)[redhat.com,infradead.org,xen.org,web.de]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FREEMAIL_ENVRCPT(0.00)[web.de] X-Rspamd-Queue-Id: 5CECF5BCEB 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: 1771345111588154100 Content-Type: text/plain; charset="utf-8" From: Peter Xu This function is used by both COLO and Xen. Simplify it with two changes: - Remove checks on qemu_savevm_se_iterable(): this is not needed as vmstate_save() also checks for "save_state() || vmsd" instead. Here, save_setup() (or say, iterable states) should be mutual exclusive to "save_state() || vmsd" [*]. - Remove migrate_error_propagate(): both of the users are not using live migration framework, but raw vmstate operations. Error propagation is only needed for query-migrate persistence. [*] One tricky user is VFIO, who provided _both_ save_state() and save_setup(). However VFIO mustn't have been used in these paths or it means both COLO and Xen have ignored VFIO data instead (that is, qemu_savevm_se_iterable() will return true for VFIO). Hence, this change is safe. Cc: David Woodhouse Cc: Paul Durrant Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-24-peterx@r= edhat.com [commit msg: s/not needed for/only needed for] Signed-off-by: Fabiano Rosas --- migration/savevm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 130b9764a7..b29272db3b 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1897,13 +1897,8 @@ int qemu_save_device_state(QEMUFile *f) QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { int ret; =20 - if (qemu_savevm_se_iterable(se)) { - continue; - } ret =3D vmstate_save(f, se, NULL, &local_err); if (ret) { - migrate_error_propagate(migrate_get_current(), - error_copy(local_err)); error_report_err(local_err); return ret; } --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345035; cv=none; d=zohomail.com; s=zohoarc; b=HCYJCcxvCsdXtowv3dshckXf8UFH9wDAYyJj2bvqkbVTjWlcd5mgVXyQuvmMiuuaUoVX/w6Azl+4BdYjg4FBADhtTyXhZc5eexmP4HsKlkSuMdNhl7tAxOdsrwUHz0Rl/nPdNCTCH4i891Yrhf5JFcT6JWmiax5xJh7BYrA7KtM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345035; 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=DtTv1je5CyqSvnbsAfVhoJ21iD/5ZKXGp6EmA4yPnGc=; b=oBIiRXczvCx85BcJzZKWfhmAWYJZ77Pyx999RhnDa5u2y9gSmx7k22zyLoayApK7mAAxXzfX6lJCv5Qgb2z6SWGwt2ijMskccMQmicu1Xbs6VPFrhEYX4WFiMYxa5h+qbDa2PNeeWOSPm1S+v//DJb5ANlOsUJ2/WbIBb/YNoS8= 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 1771345035675465.32355884924266; Tue, 17 Feb 2026 08:17:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkX-00044q-2j; Tue, 17 Feb 2026 11:16:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkV-00044J-Lt for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:31 -0500 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 1vsNkT-0003H1-Jx for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:31 -0500 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 754EF5BCF4; Tue, 17 Feb 2026 16:15: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 BF2D63EA66; Tue, 17 Feb 2026 16:15:37 +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 2K2pICmUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344939; 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=DtTv1je5CyqSvnbsAfVhoJ21iD/5ZKXGp6EmA4yPnGc=; b=Cob0VPCgNur3JlqPV4hLs7A3rBLJ33T8tdKsia2BvNMj0yBGMAUudtb4K4Vt8sG5e/VJ7M y8YGrkJ5G7BQSnxVmCfBhtoSy/i5trDodU8a0LIQcsqNiIyULV97Dl4yYX4lPqaIxSjYMX Af1Mh4wD821G1sujjW2WptJTzBoJeFY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344939; 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=DtTv1je5CyqSvnbsAfVhoJ21iD/5ZKXGp6EmA4yPnGc=; b=Mt65+UdgTIIQSTo5OTsALSahj19I0boXTrFhIJZ0kvBhcsE7PcgxyXq7kr+iexe6MBeDZT GOQR6+PyJUuF/MBw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344939; 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=DtTv1je5CyqSvnbsAfVhoJ21iD/5ZKXGp6EmA4yPnGc=; b=Cob0VPCgNur3JlqPV4hLs7A3rBLJ33T8tdKsia2BvNMj0yBGMAUudtb4K4Vt8sG5e/VJ7M y8YGrkJ5G7BQSnxVmCfBhtoSy/i5trDodU8a0LIQcsqNiIyULV97Dl4yYX4lPqaIxSjYMX Af1Mh4wD821G1sujjW2WptJTzBoJeFY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344939; 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=DtTv1je5CyqSvnbsAfVhoJ21iD/5ZKXGp6EmA4yPnGc=; b=Mt65+UdgTIIQSTo5OTsALSahj19I0boXTrFhIJZ0kvBhcsE7PcgxyXq7kr+iexe6MBeDZT GOQR6+PyJUuF/MBw== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , David Woodhouse , Paul Durrant , Lukas Straub Subject: [PULL 30/32] migration/colo/xen: Use generic helpers in qemu_save_device_state() Date: Tue, 17 Feb 2026 13:14:41 -0300 Message-ID: <20260217161443.12738-31-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email,infradead.org:email]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[redhat.com,infradead.org,xen.org,web.de]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[infradead.org:email,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345035828158500 Content-Type: text/plain; charset="utf-8" From: Peter Xu Use qemu_savevm_state_non_iterable*() helpers for saving device states, rather than walking the vmstate handlers on its own. Non-iterables can be either early_setup devices, or otherwise. Note that QEMU only has one early_setup device currently, which is virtio-mem, and I highly doubt if it is used in either COLO or Xen users.. However this step is still better needed to provide full coverage of all non-iterable vmstates. When at it, allow it to report errors. Cc: David Woodhouse Cc: Paul Durrant Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-25-peterx@r= edhat.com Signed-off-by: Fabiano Rosas --- migration/colo.c | 2 +- migration/savevm.c | 30 +++++++++++++++--------------- migration/savevm.h | 3 +-- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index db804b25a9..f7a5bd3619 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -454,7 +454,7 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, } =20 /* Note: device state is saved into buffer */ - ret =3D qemu_save_device_state(fb); + ret =3D qemu_save_device_state(fb, &local_err); =20 bql_unlock(); if (ret < 0) { diff --git a/migration/savevm.c b/migration/savevm.c index b29272db3b..3a16c467b2 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1887,26 +1887,24 @@ static bool qemu_savevm_se_iterable(SaveStateEntry = *se) return se->ops && se->ops->save_setup; } =20 -int qemu_save_device_state(QEMUFile *f) +int qemu_save_device_state(QEMUFile *f, Error **errp) { - Error *local_err =3D NULL; - SaveStateEntry *se; + int ret; =20 - cpu_synchronize_all_states(); + /* Both COLO and Xen never use vmdesc, hence NULL. */ + ret =3D qemu_savevm_state_non_iterable_early(f, NULL, errp); + if (ret) { + return ret; + } =20 - QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { - int ret; - - ret =3D vmstate_save(f, se, NULL, &local_err); - if (ret) { - error_report_err(local_err); - return ret; - } + ret =3D qemu_savevm_state_non_iterable(f, errp); + if (ret) { + return ret; } =20 qemu_savevm_state_end(f); =20 - return qemu_file_get_error(f); + return 0; } =20 static SaveStateEntry *find_se(const char *idstr, uint32_t instance_id) @@ -3346,9 +3344,11 @@ void qmp_xen_save_devices_state(const char *filename= , bool has_live, bool live, f =3D qemu_file_new_output(QIO_CHANNEL(ioc)); object_unref(OBJECT(ioc)); qemu_savevm_send_header(f); - ret =3D qemu_save_device_state(f); + ret =3D qemu_save_device_state(f, errp); if (ret < 0 || qemu_fclose(f) < 0) { - error_setg(errp, "saving Xen device state failed"); + if (*errp =3D=3D NULL) { + error_setg(errp, "saving Xen device state failed"); + } } else { /* libxl calls the QMP command "stop" before calling * "xen-save-devices-state" and in case of migration failure, libxl diff --git a/migration/savevm.h b/migration/savevm.h index 6a589b2990..2ba0881f3b 100644 --- a/migration/savevm.h +++ b/migration/savevm.h @@ -66,8 +66,7 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, c= onst char *name, uint64_t *start_list, uint64_t *length_list); void qemu_savevm_send_colo_enable(QEMUFile *f); -int qemu_save_device_state(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); int qemu_loadvm_state_main(QEMUFile *f, MigrationIncomingState *mis, --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345023; cv=none; d=zohomail.com; s=zohoarc; b=X9NOM6gb8IPO5f7kRpb0H6R75wXBpRNadq08UblCa3Hhp/2qR0uwcncOiyzXUbBu2DnzOMvxk3lDE7NhBRq75acChCL9OWmhYa0atNlG9frvWK2q3/riptwWVePtKOoogI/4QLBDxYkePiah4Ms5kU8Yajs4hvMuk4GVhi8ksRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345023; 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=2EvnPEEeK+lCQl317NLZ+k6Vq7qnKnEmyzZiAO65r1o=; b=kaqtN8l9+5GI+zQpWjs8RHGq0hZ8+hqWVJFDYLv+9z4onwAPTbc+ZzJa1xh5IZef7KcJO7/PAFXkrxcQ/kFdFXHwYM5CODIBXnEG/Qz5oLtHdsNmXuzMtqg4HuPWetNVmVr2qcYnaJAL0FF+rMwJ9szJCc9cZp/mmnpsLN2H8l4= 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 1771345023705945.0809041796682; Tue, 17 Feb 2026 08:17:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkU-00043c-GE; Tue, 17 Feb 2026 11:16:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNkT-000438-GZ for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:29 -0500 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 1vsNkR-0003Gj-Tx for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:29 -0500 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 1E4ED3E728; Tue, 17 Feb 2026 16:15: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 DA9B13EA66; Tue, 17 Feb 2026 16:15: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 cLNzJyuUlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344941; 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=2EvnPEEeK+lCQl317NLZ+k6Vq7qnKnEmyzZiAO65r1o=; b=f7w0smVRG5HIWXdwHD4BhZcRyi+FSna+UE4rdMbFdywnhkMlXc9PKpU/M4ln//GI51hTwK 5Gv5fNW93ZXP+6dTeHVi1LIU6YDgzVqdrRLvNvtxlb74yYKJhxq9LTpsbsK5u6F+G06NmC tbJXO8IcM9YLKYps1cG0ncTULzQu/BM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344941; 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=2EvnPEEeK+lCQl317NLZ+k6Vq7qnKnEmyzZiAO65r1o=; b=mWuS/vDve18YhsWH+hchr5YH7pwkwtQ7R2h9K0dK6opeUGTA7q84xhIj+/jisDvYpg10kS djTpjiHhXNUagcAg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344941; 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=2EvnPEEeK+lCQl317NLZ+k6Vq7qnKnEmyzZiAO65r1o=; b=f7w0smVRG5HIWXdwHD4BhZcRyi+FSna+UE4rdMbFdywnhkMlXc9PKpU/M4ln//GI51hTwK 5Gv5fNW93ZXP+6dTeHVi1LIU6YDgzVqdrRLvNvtxlb74yYKJhxq9LTpsbsK5u6F+G06NmC tbJXO8IcM9YLKYps1cG0ncTULzQu/BM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344941; 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=2EvnPEEeK+lCQl317NLZ+k6Vq7qnKnEmyzZiAO65r1o=; b=mWuS/vDve18YhsWH+hchr5YH7pwkwtQ7R2h9K0dK6opeUGTA7q84xhIj+/jisDvYpg10kS djTpjiHhXNUagcAg== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 31/32] migration/cpr: Include vfio-cpr.h instead of vfio-device.h Date: Tue, 17 Feb 2026 13:14:42 -0300 Message-ID: <20260217161443.12738-32-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, suse.de:mid, suse.de:email] 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345026267154100 From: C=C3=A9dric Le Goater The file migration/cpr.c uses vmstate_cpr_vfio_devices which is declared in hw/vfio/vfio-cpr.h, not in hw/vfio/vfio-device.h. Replace the include with the correct header file to avoid pulling in unnecessary VFIO device declarations. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260211171532.1556719-1-clg@redha= t.com Signed-off-by: Fabiano Rosas --- migration/cpr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/cpr.c b/migration/cpr.c index adee2a919a..a0b37007f5 100644 --- a/migration/cpr.c +++ b/migration/cpr.c @@ -9,7 +9,7 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/vfio/vfio-device.h" +#include "hw/vfio/vfio-cpr.h" #include "migration/cpr.h" #include "migration/misc.h" #include "migration/options.h" --=20 2.51.0 From nobody Sun Apr 12 04:22:09 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=1771345104; cv=none; d=zohomail.com; s=zohoarc; b=ACigqs+bzdqtrmS5ILnFCv7QMpgH9kNTOG+d0FfcKDzjzrUaSG/Psf3qe6m8LQFHdXjwIR7wl9+PbFwmBCv1X3MNKl4qQFqUmuK94nIi921IP/bZLvDfSxG3BEevgsaUec7bk6DSESvTo6kH6wCOIxhUZXWs0EfaPkJ7/a6/c+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771345104; 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=eb9c4CVgvWkRUSSB4xutPyPwhjFtQapblTL73fb57/U=; b=Kl6rQGFzl/r6Byu4UOb81F8vqoujVf9MBYN0agHTwN6q88+MVPPXl/QifrGa0RIJ+m/eIyKTJF+gPK3yxMYqhvi6y4/D/fjCF9BlExRSLg5IBQF1c2hxyI/9YYkZkVYDM5kQ9PcbIj1TIq1xMXJg7b2AtCUPKmrxRZg4X34ZDnE= 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 1771345104111568.8995565498047; Tue, 17 Feb 2026 08:18:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsNkt-0004Q4-L0; Tue, 17 Feb 2026 11:16:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsNka-0004D2-FZ for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:36 -0500 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 1vsNkX-0003Hb-Br for qemu-devel@nongnu.org; Tue, 17 Feb 2026 11:16:34 -0500 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 BB9CB3E733; Tue, 17 Feb 2026 16:15: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 83C363EA66; Tue, 17 Feb 2026 16:15: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 oOwBEi2UlGmHTgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 16:15:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344942; 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=eb9c4CVgvWkRUSSB4xutPyPwhjFtQapblTL73fb57/U=; b=EXTvoSiz5QJkfGh+U3CuFdHlyLP5BaW4zgidMP9b9NbC2+4BjGLWjpZ8+p0rYScf0Nf6dl fB/0FPQoh0FLVOQulwAk7oFdkaj5hMIXnHz/07xuZa/YM80jema6IWqLbRwUYz0b0H79Y4 2RjA1hu7+Xa8kOQRxYYYV8mCaDzxMYI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344942; 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=eb9c4CVgvWkRUSSB4xutPyPwhjFtQapblTL73fb57/U=; b=jxXo1ded0s3CY698ln9Q78jyETzhEa/MMgsvQqOtm/G7GuMdaNaqffXlYvLAt30mW3vKcn 9Ko0o1T7I20ExIAA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771344942; 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=eb9c4CVgvWkRUSSB4xutPyPwhjFtQapblTL73fb57/U=; b=EXTvoSiz5QJkfGh+U3CuFdHlyLP5BaW4zgidMP9b9NbC2+4BjGLWjpZ8+p0rYScf0Nf6dl fB/0FPQoh0FLVOQulwAk7oFdkaj5hMIXnHz/07xuZa/YM80jema6IWqLbRwUYz0b0H79Y4 2RjA1hu7+Xa8kOQRxYYYV8mCaDzxMYI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771344942; 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=eb9c4CVgvWkRUSSB4xutPyPwhjFtQapblTL73fb57/U=; b=jxXo1ded0s3CY698ln9Q78jyETzhEa/MMgsvQqOtm/G7GuMdaNaqffXlYvLAt30mW3vKcn 9Ko0o1T7I20ExIAA== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Peter Maydell Subject: [PULL 32/32] tests/qtest/migration/tls-tests.c: Don't use tls_psk end hook for no_tls tests Date: Tue, 17 Feb 2026 13:14:43 -0300 Message-ID: <20260217161443.12738-33-farosas@suse.de> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260217161443.12738-1-farosas@suse.de> References: <20260217161443.12738-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%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email,linaro.org:email]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[linaro.org:email,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] 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: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1771345106154158500 Content-Type: text/plain; charset="utf-8" From: Peter Maydell If you run the TLS tests under a clang undefined-behaviour sanitizer build it will fall over like this: ../../tests/unit/crypto-tls-psk-helpers.c:53:12: runtime error: null pointe= r passed as argument 1, which is declared to never be null /usr/include/unistd.h:858:48: note: nonnull attribute specified here #0 0x62bd810762ee in test_tls_psk_cleanup /home/pm215/qemu/build/clang/= ../../tests/unit/crypto-tls-psk-helpers.c:53:5 #1 0x62bd81073f89 in migrate_hook_end_tls_psk /home/pm215/qemu/build/cl= ang/../../tests/qtest/migration/tls-tests.c:101:5 #2 0x62bd81062ef0 in test_precopy_common /home/pm215/qemu/build/clang/.= ./../tests/qtest/migration/framework.c:947:9 This happens because test_precopy_tcp_no_tls() uses a custom start_hook that only sets a couple of parameters, but reuses the tsk_psk end_hook. However, the end_hook runs cleanup that assumes that the data was set up by migrate_hook_start_tls_psk_common(). In particular, it will unconditionally call test_tls_psk_cleanup(data->pskfile), and test_tls_psk_cleanup() will unconditionally unlink() the filename it is passed, which is undefined behaviour if you pass it a NULL pointer. Instead of creating a TestMigrateTLSPSKData struct which we never set any fields in and requiring the migrate_hook_end_tls_psk() hook to cope with that, don't allocate the struct in the start_hook. Then there is nothing we need to clean up, and we can set the end_hook to NULL (which the test framework will interpret as "don't call any end_hook"). Signed-off-by: Peter Maydell Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/qemu-devel/20260212114747.1103466-1-peter.may= dell@linaro.org [no need to copy stable] Signed-off-by: Fabiano Rosas --- tests/qtest/migration/tls-tests.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/qtest/migration/tls-tests.c b/tests/qtest/migration/tls-= tests.c index bf0bb06a29..4ce7f6c676 100644 --- a/tests/qtest/migration/tls-tests.c +++ b/tests/qtest/migration/tls-tests.c @@ -488,20 +488,18 @@ static void test_precopy_tcp_tls_psk_mismatch(char *n= ame, MigrateCommon *args) =20 static void *migrate_hook_start_no_tls(QTestState *from, QTestState *to) { - struct TestMigrateTLSPSKData *data =3D - g_new0(struct TestMigrateTLSPSKData, 1); - migrate_set_parameter_null(from, "tls-creds"); migrate_set_parameter_null(to, "tls-creds"); =20 - return data; + return NULL; } =20 static void test_precopy_tcp_no_tls(char *name, MigrateCommon *args) { args->listen_uri =3D "tcp:127.0.0.1:0"; args->start_hook =3D migrate_hook_start_no_tls; - args->end_hook =3D migrate_hook_end_tls_psk; + /* the no_tls start hook requires no cleanup actions */ + args->end_hook =3D NULL; =20 test_precopy_common(args); } --=20 2.51.0