From patchwork Fri Jul 22 19:04:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 12926799 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E17FC43334 for ; Fri, 22 Jul 2022 19:19:24 +0000 (UTC) Received: from localhost ([::1]:57998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oEyBH-0005x0-K1 for qemu-devel@archiver.kernel.org; Fri, 22 Jul 2022 15:19:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oExy0-00075R-FS for qemu-devel@nongnu.org; Fri, 22 Jul 2022 15:05:43 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:42017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oExxz-0005Ja-0D for qemu-devel@nongnu.org; Fri, 22 Jul 2022 15:05:40 -0400 Received: from thinkpad.redhat.com ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MofPt-1ni3zB026z-00p4aL; Fri, 22 Jul 2022 21:04:52 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Eric Blake , Thomas Huth , Laurent Vivier , Markus Armbruster , "Dr. David Alan Gilbert" , Jason Wang , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefano Brivio Subject: [PATCH v7 06/14] net: stream: Don't ignore EINVAL on netdev socket connection Date: Fri, 22 Jul 2022 21:04:34 +0200 Message-Id: <20220722190442.301310-7-lvivier@redhat.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220722190442.301310-1-lvivier@redhat.com> References: <20220722190442.301310-1-lvivier@redhat.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:99Wk36CqkFIlPROD5LHzLuXOhiqq3plOfTiqCz2xrv7hOq62Kge oOYfrGQgIyx7DUbcNiO+R8ZNDo+xw1qPUXsZMGjqZKZB1SszB3zO/QlW1UONLKZsGlyKcHk RBAEKOCC1GJV3ccr+Jz3h4TMJEvxVlP2ECHMQFFdf1HPzXPsu3jIyzWr2fR7jTZq7ZOIiiD G3rDUIqu9Pq9M8Umzk07A== X-UI-Out-Filterresults: notjunk:1;V03:K0:2ws3I3Z6ldg=:sTo8CzQiKwqCw+VDfAluXW OYgk5/RrwL5UFF1uUzzfChVQVQshAMDjiCh5PQdalz+LXfWBid4z3NC6/FH1BoZ0c+Dwzld/0 rWMk15ZujEiZstmHnAriBbPar9NrsPHczmaFayizlsZI8LGxvFBLNk+FkFzcNNj524tpZqfyy kl/O3LxMNrwDMKekOIVHdXS0yJgI55ciFbIqRhh4hozB5G7ufztk7UFX6edI4mtlXYL1EhKCc /VZ94Ue8eZDlqt/0ms6v3i2kyvrkio3LORzfldFNY9PP0xiyTCG7tGf3EQE0Iyw1BatY1E6vL egSOPlFxHre2RXOBYOsB1uDRvYg//pzwWZqJ6i5J7H0XnidOwsw36rKbt/Iu5Scm0Nsh+C3fJ NRlwjA4EF+V2tEz+BAN9B6Wt9NKikGqJ7pTrnnIKROj5DN32Recri8PfUVJqW6JbvmZ/bzImi RXLJBenR2vP2lThh7y1bEIX/MR8CvPdpkOXq7VAXAB35f4wtj4UqfNY0G8Edaj727jCql1Eg3 CE2s1ukmO0TGN9w6XG92mNm0tYcQNyLJJPA9GLtho/lB+Pn1m4YsLnSv2iG/je2ulUmTJ/kti V2rrXs/bZfpSrowSqHZJbkVDNx7yAD+N8lJ8qCPqSXxPNNhMlm4WlgTWwKlAby7nUSFsxCWI/ eI0wt+4qFuEzLhPMHEnNhGiYsJqxwvOXOc//NZHaFRVuqkZNl2O5JdVAyMEA/r9+dOycC/SnB FPSvsQZKqX47SnjM1djEJFhlL3XCfXgguuTNAQ== Received-SPF: permerror client-ip=212.227.126.134; envelope-from=lvivier@redhat.com; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_FAIL=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Stefano Brivio Other errors are treated as failure by net_stream_client_init(), but if connect() returns EINVAL, we'll fail silently. Remove the related exception. Signed-off-by: Stefano Brivio [lvivier: applied to net/stream.c] Signed-off-by: Laurent Vivier Reviewed-by: Daniel P. Berrangé --- net/stream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/stream.c b/net/stream.c index 0851e90becca..e8afbaca50b6 100644 --- a/net/stream.c +++ b/net/stream.c @@ -363,8 +363,7 @@ static int net_stream_client_init(NetClientState *peer, if (errno == EINTR || errno == EWOULDBLOCK) { /* continue */ } else if (errno == EINPROGRESS || - errno == EALREADY || - errno == EINVAL) { + errno == EALREADY) { break; } else { error_setg_errno(errp, errno, "can't connect socket");