From nobody Mon Feb 9 20:59:58 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1640172817; cv=none; d=zohomail.com; s=zohoarc; b=nTEr7CX9gD9/leSTfTFFZpnodHFnGTDYpHsA8ff5xHmTPjx3X31BqYojeHAIK+zZSF5EdBdCvFohOz1r8ok6WLZiEfnALZoyvFKwznKiwZYPn8+a1naTMrHr7UOP8XUOl6Bx1OXqnsi7P34SyT9PtduhnzWIDZkvyVGKCK9d8vA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640172817; 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=p23BND77yA3C1MNnRUW5sOkWOwYsyt+qJoxOhu7Dyl8=; b=ffLYzqjP1BvmpQpXEQ74hYmXhBCBk+lvqC8peOTCpcwtKARHcMCiV2jZKgmyWegul2ObGbI7yuNAAQcj932NAvQo2qAYJqaU4FOuD+cYfReZwv6dyogPA/HU+1k9OjuFnScSA2E7nlCS35bQtATyxET0dtjzY/ja+1UHIUrIgdM= 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 1640172817211751.7395912609601; Wed, 22 Dec 2021 03:33:37 -0800 (PST) Received: from localhost ([::1]:52466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzzsF-0007ed-QH for importer@patchew.org; Wed, 22 Dec 2021 06:33:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzzqE-0005WR-Ud for qemu-devel@nongnu.org; Wed, 22 Dec 2021 06:31:30 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:57234) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzzqD-0006hb-4h for qemu-devel@nongnu.org; Wed, 22 Dec 2021 06:31:30 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 38F5F212BD; Wed, 22 Dec 2021 11:31:26 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0545913D10; Wed, 22 Dec 2021 11:31:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KGZyO40Mw2HBFQAAMHmgww (envelope-from ); Wed, 22 Dec 2021 11:31:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1640172686; 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=p23BND77yA3C1MNnRUW5sOkWOwYsyt+qJoxOhu7Dyl8=; b=g3TxDq4EN8IDxfaT6yhQKRpfo/eHbby5QSkTR8QnDUM5kLXzkCC/N8ZwWO7X4OWrqRpcwe oIqKTwTqwlXfRr5DFtUEQlslUS/5vl1isAsY1R/njHIHbeoLkJG5WDmmbeAf1ZqIajfAEC OfkuKmp83ytHsVMTtpwBh6z/S8XyRIw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1640172686; 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=p23BND77yA3C1MNnRUW5sOkWOwYsyt+qJoxOhu7Dyl8=; b=lwdCnoVmJSnE9ql8tT09nQqp+BcAr9gNtmSk24xZoEsm9Wome7tDq6I0951tWCi2EpGLO0 nJRi73+UT0rHVlCw== From: Li Zhang To: quintela@redhat.com, dgilbert@redhat.com, cfontana@suse.de, qemu-devel@nongnu.org Subject: [PATCH 1/2] multifd: cleanup the function multifd_channel_connect Date: Wed, 22 Dec 2021 12:30:48 +0100 Message-Id: <20211222113049.9326-2-lizhang@suse.de> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211222113049.9326-1-lizhang@suse.de> References: <20211222113049.9326-1-lizhang@suse.de> 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=195.135.220.28; envelope-from=lizhang@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, 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: , Cc: Li Zhang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1640172818300100005 Content-Type: text/plain; charset="utf-8" Cleanup multifd_channel_connect Signed-off-by: Li Zhang Reviewed-by: Juan Quintela --- migration/multifd.c | 49 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/migration/multifd.c b/migration/multifd.c index 212be1ed04..4ec40739e0 100644 --- a/migration/multifd.c +++ b/migration/multifd.c @@ -801,33 +801,32 @@ static bool multifd_channel_connect(MultiFDSendParams= *p, trace_multifd_set_outgoing_channel( ioc, object_get_typename(OBJECT(ioc)), p->tls_hostname, error); =20 - if (!error) { - if (s->parameters.tls_creds && - *s->parameters.tls_creds && - !object_dynamic_cast(OBJECT(ioc), - TYPE_QIO_CHANNEL_TLS)) { - multifd_tls_channel_connect(p, ioc, &error); - if (!error) { - /* - * tls_channel_connect will call back to this - * function after the TLS handshake, - * so we mustn't call multifd_send_thread until then - */ - return true; - } else { - return false; - } - } else { - migration_ioc_register_yank(ioc); - p->registered_yank =3D true; - p->c =3D ioc; - qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, - QEMU_THREAD_JOINABLE); - } - return true; + if (error) { + return false; } =20 - return false; + if (s->parameters.tls_creds && + *s->parameters.tls_creds && + !object_dynamic_cast(OBJECT(ioc), + TYPE_QIO_CHANNEL_TLS)) { + multifd_tls_channel_connect(p, ioc, &error); + if (error) { + return false; + } + /* + * tls_channel_connect will call back to this + * function after the TLS handshake, + * so we mustn't call multifd_send_thread until then + */ + return true; + } else { + migration_ioc_register_yank(ioc); + p->registered_yank =3D true; + p->c =3D ioc; + qemu_thread_create(&p->thread, p->name, multifd_send_thread, p, + QEMU_THREAD_JOINABLE); + } + return true; } =20 static void multifd_new_send_channel_cleanup(MultiFDSendParams *p, --=20 2.31.1