From nobody Mon Feb 9 23:02:48 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676256839; cv=none; d=zohomail.com; s=zohoarc; b=lOl+EIUU3w2qXwhkWsqDLtfxp8tvGckp9x3DrivM7PruTytqqm1GZV2J5w3q1mQj/HIG/YxXkv31/EF1fBmbNsO+6Pzkjr+a6udne9wn0sO8MWMCBZOW0epoIn83H6k2xCodVP+hGSpmFfA1fXfTQawa2rJL5a5oH3SEFv/Q8YM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676256839; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Kvm5CeInbbh1Y+6Wfd0BER4Em57orWCfA6AmQdkHIMQ=; b=j7/zAsXIO6VSmiKPOQwtVspS/RAklF6y57z8aHqz4ZFuw4BgjftiTCfomtDUpwWd+IbhlnMS0iWPZApJ1gy45ufZwydkxDtQ7WUeRWPVuXIg7Ab/xbnPuYE3Zuk0d/kyml0EoljAy2ni1f9zzi+UmDOonlOR/nuNdNJQpGJnkQA= 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 1676256839366286.1437693161263; Sun, 12 Feb 2023 18:53:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pROxC-0002Gz-QG; Sun, 12 Feb 2023 21:52: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 1pROxB-0002GP-5N for qemu-devel@nongnu.org; Sun, 12 Feb 2023 21:52:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pROx9-0006wC-LK for qemu-devel@nongnu.org; Sun, 12 Feb 2023 21:52:28 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-290-PGGPUqwkPs2VY4CxCERQdQ-1; Sun, 12 Feb 2023 21:52:25 -0500 Received: by mail-wr1-f70.google.com with SMTP id r11-20020a5d498b000000b002c5588d962fso117791wrq.10 for ; Sun, 12 Feb 2023 18:52:25 -0800 (PST) Received: from redhat.com ([46.136.252.173]) by smtp.gmail.com with ESMTPSA id q14-20020a5d574e000000b002bfb02153d1sm9399397wrw.45.2023.02.12.18.52.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Feb 2023 18:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676256747; h=from:from:reply-to:subject:subject: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=Kvm5CeInbbh1Y+6Wfd0BER4Em57orWCfA6AmQdkHIMQ=; b=AQajwcI2mSti19T/0wiK0TI/wuMnW6wUUJ3QsfHGlUZzqdeo+cDwX2kLLREyfZWDDlROV9 o9ZT8WXclvRvMyERT5VsW6Wt9sPGH39a6Qgm4OAS0Iqeh0cGo83Mn+T83YjYvsGp0zDooq PPzNZUQUjN6QGcI0s9GLF2fJne6WaEo= X-MC-Unique: PGGPUqwkPs2VY4CxCERQdQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kvm5CeInbbh1Y+6Wfd0BER4Em57orWCfA6AmQdkHIMQ=; b=VUIvFOF2oy6j8Xv2Tr2PgsC69eLcz01Rv0DvA0bBdWvOMKUkfraS4fJwj9xSHmmdun 58BHPcJIkMKx7zqwAOHsPJGwQpH5iuiH1z41mh2ND9/ih+nW6ffINiVSwN1iaVVf1UC0 aXUiRMlmc9wfJWCyYmOjbRh2N0eJC169Nb2H56UWnuDbVU+Drdd4qZ0x5dwU/dnvmLQZ xol3FAFGIS/nUyxzFhYszEjvvNsgfYWxmYSf90gqsiXvbUoSjpYC2IOVgYvGvU3X33zr lhFHNbE/dLw6MohmSM6bttPc3dh0eKxFUoEWj591FBRR9keqnS0Jl8PpHuN7kNF0WW16 QVag== X-Gm-Message-State: AO0yUKUy15wKTl5cquNf3iMSxnowobXSfkMOUXunsLE1tFEiBlRu7D5j /Fl44t3kbe1YQvouLzkzVZZNd2CcnvLyReDOfDL+V27T/ehSkqJ5i5auneMd77+6ZG0tBVXAa7x 0aU2ixrTYt52dWJ57hggaSLb0bl5oeuQUcaiDAzqMEGb1uNSHecF0Ty5OSPDj+94KlCRhAuho X-Received: by 2002:a05:6000:183:b0:2c5:52fc:ed1a with SMTP id p3-20020a056000018300b002c552fced1amr3039919wrx.55.1676256743347; Sun, 12 Feb 2023 18:52:23 -0800 (PST) X-Google-Smtp-Source: AK7set8QTsdZxrFsE5C/a7ia2LHZRzmFU1DHRlYMMrWGARW+rKgCWIO2I68jvndjNTBB/iIfhpmEOA== X-Received: by 2002:a05:6000:183:b0:2c5:52fc:ed1a with SMTP id p3-20020a056000018300b002c552fced1amr3039900wrx.55.1676256743028; Sun, 12 Feb 2023 18:52:23 -0800 (PST) From: Juan Quintela To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Cornelia Huck , Thomas Huth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Juan Quintela , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , "Dr. David Alan Gilbert" , kvm@vger.kernel.org, "Michael S. Tsirkin" , Leonardo Bras , Li Xiaohui , Peter Xu Subject: [PULL 18/22] migration/multifd: Change multifd_load_cleanup() signature and usage Date: Mon, 13 Feb 2023 03:51:46 +0100 Message-Id: <20230213025150.71537-19-quintela@redhat.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213025150.71537-1-quintela@redhat.com> References: <20230213025150.71537-1-quintela@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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: 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 @redhat.com) X-ZM-MESSAGEID: 1676256841152100003 Content-Type: text/plain; charset="utf-8" From: Leonardo Bras Since it's introduction in commit f986c3d256 ("migration: Create multifd migration threads"), multifd_load_cleanup() never returned any value different than 0, neither set up any error on errp. Even though, on process_incoming_migration_bh() an if clause uses it's return value to decide on setting autostart =3D false, which will never happen. In order to simplify the codebase, change multifd_load_cleanup() signature to 'void multifd_load_cleanup(void)', and for every usage remove error handling or decision made based on return value !=3D 0. Fixes: b5eea99ec2 ("migration: Add yank feature") Reported-by: Li Xiaohui Signed-off-by: Leonardo Bras Reviewed-by: Juan Quintela Reviewed-by: Peter Xu Signed-off-by: Juan Quintela --- migration/multifd.h | 2 +- migration/migration.c | 14 ++++---------- migration/multifd.c | 6 ++---- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/migration/multifd.h b/migration/multifd.h index ff3aa2e2e9..9a7e1a8826 100644 --- a/migration/multifd.h +++ b/migration/multifd.h @@ -16,7 +16,7 @@ int multifd_save_setup(Error **errp); void multifd_save_cleanup(void); int multifd_load_setup(Error **errp); -int multifd_load_cleanup(Error **errp); +void multifd_load_cleanup(void); bool multifd_recv_all_channels_created(void); void multifd_recv_new_channel(QIOChannel *ioc, Error **errp); void multifd_recv_sync_main(void); diff --git a/migration/migration.c b/migration/migration.c index a5c22e327d..5bf332fdd2 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -559,13 +559,7 @@ static void process_incoming_migration_bh(void *opaque) */ qemu_announce_self(&mis->announce_timer, migrate_announce_params()); =20 - if (multifd_load_cleanup(&local_err) !=3D 0) { - error_report_err(local_err); - autostart =3D false; - } - /* If global state section was not received or we are in running - state, we need to obey autostart. Any other state is set with - runstate_set. */ + multifd_load_cleanup(); =20 dirty_bitmap_mig_before_vm_start(); =20 @@ -665,9 +659,9 @@ fail: migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_STATUS_FAILED); qemu_fclose(mis->from_src_file); - if (multifd_load_cleanup(&local_err) !=3D 0) { - error_report_err(local_err); - } + + multifd_load_cleanup(); + exit(EXIT_FAILURE); } =20 diff --git a/migration/multifd.c b/migration/multifd.c index 99a59830c8..cac8496edc 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -1013,12 +1013,12 @@ static void multifd_recv_terminate_threads(Error *e= rr) } } =20 -int multifd_load_cleanup(Error **errp) +void multifd_load_cleanup(void) { int i; =20 if (!migrate_use_multifd()) { - return 0; + return; } multifd_recv_terminate_threads(NULL); for (i =3D 0; i < migrate_multifd_channels(); i++) { @@ -1058,8 +1058,6 @@ int multifd_load_cleanup(Error **errp) multifd_recv_state->params =3D NULL; g_free(multifd_recv_state); multifd_recv_state =3D NULL; - - return 0; } =20 void multifd_recv_sync_main(void) --=20 2.39.1