From nobody Fri Nov 7 04:02:26 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545436314535436.84137654810604; Fri, 21 Dec 2018 15:51:54 -0800 (PST) Received: from localhost ([::1]:48944 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaUa9-00080m-8o for importer@patchew.org; Fri, 21 Dec 2018 18:51:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaUWN-0005AM-Pg for qemu-devel@nongnu.org; Fri, 21 Dec 2018 18:48:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaUWN-0004qE-37 for qemu-devel@nongnu.org; Fri, 21 Dec 2018 18:47:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37878) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaUWL-0004o4-HT; Fri, 21 Dec 2018 18:47:57 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DFC317FDE4; Fri, 21 Dec 2018 23:47:56 +0000 (UTC) Received: from localhost (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79AD7600CD; Fri, 21 Dec 2018 23:47:56 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Date: Sat, 22 Dec 2018 00:47:49 +0100 Message-Id: <20181221234750.23577-3-mreitz@redhat.com> In-Reply-To: <20181221234750.23577-1-mreitz@redhat.com> References: <20181221234750.23577-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 21 Dec 2018 23:47:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/3] iotests: Bind qemu-nbd to localhost in 147 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" By default, qemu-nbd binds to 0.0.0.0. However, we then proceed to connect to "localhost". Usually, this works out fine; but if this test is run concurrently, some other test function may have bound a different server to ::1 (on the same port -- you can bind different serves to the same port, as long as one is on IPv4 and the other on IPv6). So running qemu-nbd works, it can bind to 0.0.0.0:NBD_PORT. But potentially a concurrent test has successfully taken [::1]:NBD_PORT. In this case, trying to connect to "localhost" will lead us to the IPv6 instance, where we do not want to end up. Fix this by just binding to "localhost". This will make qemu-nbd error out immediately and not give us cryptic errors later. (Also, it will allow us to just try a different port as of a future patch.) Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/147 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147 index 05b374b7d3..3e10a9969e 100755 --- a/tests/qemu-iotests/147 +++ b/tests/qemu-iotests/147 @@ -92,7 +92,7 @@ class QemuNBD(NBDBlockdevAddBase): self.assertEqual(qemu_nbd('-f', imgfmt, test_img, *args), 0) =20 def test_inet(self): - self._server_up('-p', str(NBD_PORT)) + self._server_up('-b', 'localhost', '-p', str(NBD_PORT)) address =3D { 'type': 'inet', 'data': { 'host': 'localhost', --=20 2.19.2