From nobody Sat May 4 20:50:21 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503589024735881.3795598676907; Thu, 24 Aug 2017 08:37:04 -0700 (PDT) Received: from localhost ([::1]:49064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkuBr-0007LB-Ii for importer@patchew.org; Thu, 24 Aug 2017 11:37:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dku92-0004xU-Ez for qemu-devel@nongnu.org; Thu, 24 Aug 2017 11:34:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dku91-0000Bz-ES for qemu-devel@nongnu.org; Thu, 24 Aug 2017 11:34:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33220) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dku8y-0000Ad-OK; Thu, 24 Aug 2017 11:34:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B1BE986647; Thu, 24 Aug 2017 15:34:03 +0000 (UTC) Received: from localhost (ovpn-116-96.ams2.redhat.com [10.36.116.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CD4E5D736; Thu, 24 Aug 2017 15:33:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B1BE986647 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=stefanha@redhat.com From: Stefan Hajnoczi To: Date: Thu, 24 Aug 2017 16:33:43 +0100 Message-Id: <20170824153345.2244-2-stefanha@redhat.com> In-Reply-To: <20170824153345.2244-1-stefanha@redhat.com> References: <20170824153345.2244-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 24 Aug 2017 15:34:03 +0000 (UTC) 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 1/3] nbd-client: enter read_reply_co during init to avoid crash 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 , Paolo Bonzini , Stefan Hajnoczi , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The following segfault is encountered if the NBD server closes the UNIX domain socket immediately after negotiation: Program terminated with signal SIGSEGV, Segmentation fault. #0 aio_co_schedule (ctx=3D0x0, co=3D0xd3c0ff2ef0) at util/async.c:441 441 QSLIST_INSERT_HEAD_ATOMIC(&ctx->scheduled_coroutines, (gdb) bt #0 0x000000d3c01a50f8 in aio_co_schedule (ctx=3D0x0, co=3D0xd3c0ff2ef0) = at util/async.c:441 #1 0x000000d3c012fa90 in nbd_coroutine_end (bs=3Dbs@entry=3D0xd3c0fec650= , request=3D) at block/nbd-client.c:207 #2 0x000000d3c012fb58 in nbd_client_co_preadv (bs=3D0xd3c0fec650, offset= =3D0, bytes=3D, qiov=3D0x7ffc10a91b20, flags=3D0) at block/n= bd-client.c:237 #3 0x000000d3c0128e63 in bdrv_driver_preadv (bs=3Dbs@entry=3D0xd3c0fec65= 0, offset=3Doffset@entry=3D0, bytes=3Dbytes@entry=3D512, qiov=3Dqiov@entry= =3D0x7ffc10a91b20, flags=3D0) at block/io.c:836 #4 0x000000d3c012c3e0 in bdrv_aligned_preadv (child=3Dchild@entry=3D0xd3= c0ff51d0, req=3Dreq@entry=3D0x7f31885d6e90, offset=3Doffset@entry=3D0, byte= s=3Dbytes@entry=3D512, align=3Dalign@entry=3D1, qiov=3Dqiov@entry=3D0x7ffc1= 0a91b20, flags=3D0) at block/io.c:1086 #5 0x000000d3c012c6b8 in bdrv_co_preadv (child=3D0xd3c0ff51d0, offset=3D= offset@entry=3D0, bytes=3Dbytes@entry=3D512, qiov=3Dqiov@entry=3D0x7ffc10a9= 1b20, flags=3Dflags@entry=3D0) at block/io.c:1182 #6 0x000000d3c011cc17 in blk_co_preadv (blk=3D0xd3c0ff4f80, offset=3D0, = bytes=3D512, qiov=3D0x7ffc10a91b20, flags=3D0) at block/block-backend.c:1032 #7 0x000000d3c011ccec in blk_read_entry (opaque=3D0x7ffc10a91b40) at blo= ck/block-backend.c:1079 #8 0x000000d3c01bbb96 in coroutine_trampoline (i0=3D, i1= =3D) at util/coroutine-ucontext.c:79 #9 0x00007f3196cb8600 in __start_context () at /lib64/libc.so.6 The problem is that nbd_client_init() uses nbd_client_attach_aio_context() -> aio_co_schedule(new_context, client->read_reply_co). Execution of read_reply_co is deferred to a BH which doesn't run until later. In the mean time blk_co_preadv() can be called and nbd_coroutine_end() calls aio_wake() on read_reply_co. At this point in time read_reply_co's ctx isn't set because it has never been entered yet. This patch enters read_reply_co directly in nbd_client_attach_aio_context(). This is safe because new_context is acquired by the caller. This ensures that read_reply_co reaches its first yield point and its ctx is set up. Note this only happens with UNIX domain sockets on Linux. It doesn't seem possible to reproduce this with TCP sockets. Cc: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- block/nbd-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 25bcaa2346..0a7f32779e 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -371,7 +371,7 @@ void nbd_client_attach_aio_context(BlockDriverState *bs, { NBDClientSession *client =3D nbd_get_client_session(bs); qio_channel_attach_aio_context(QIO_CHANNEL(client->ioc), new_context); - aio_co_schedule(new_context, client->read_reply_co); + qemu_aio_coroutine_enter(new_context, client->read_reply_co); } =20 void nbd_client_close(BlockDriverState *bs) --=20 2.13.5 From nobody Sat May 4 20:50:21 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503589165806112.26126488550233; Thu, 24 Aug 2017 08:39:25 -0700 (PDT) Received: from localhost ([::1]:49073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkuE8-00007N-2f for importer@patchew.org; Thu, 24 Aug 2017 11:39:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dku9B-000543-2L for qemu-devel@nongnu.org; Thu, 24 Aug 2017 11:34:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dku9A-0000FE-7v for qemu-devel@nongnu.org; Thu, 24 Aug 2017 11:34:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25071) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dku94-0000Cn-W3; Thu, 24 Aug 2017 11:34:11 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E198A81E01; Thu, 24 Aug 2017 15:34:09 +0000 (UTC) Received: from localhost (ovpn-116-96.ams2.redhat.com [10.36.116.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A1487008A; Thu, 24 Aug 2017 15:34:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E198A81E01 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=stefanha@redhat.com From: Stefan Hajnoczi To: Date: Thu, 24 Aug 2017 16:33:44 +0100 Message-Id: <20170824153345.2244-3-stefanha@redhat.com> In-Reply-To: <20170824153345.2244-1-stefanha@redhat.com> References: <20170824153345.2244-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 24 Aug 2017 15:34:10 +0000 (UTC) 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] qemu-iotests: improve nbd-fault-injector.py startup protocol 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 , Paolo Bonzini , Stefan Hajnoczi , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently 083 waits for the nbd-fault-injector.py server to start up by looping until netstat shows the TCP listen socket. The startup protocol can be simplified by passing a 0 port number to nbd-fault-injector.py. The kernel will allocate a port in bind(2) and the final port number can be printed by nbd-fault-injector.py. This should make it slightly nicer and less TCP-specific to wait for server startup. This patch changes nbd-fault-injector.py, the next one will rewrite server startup in 083. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake --- tests/qemu-iotests/nbd-fault-injector.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index 6c07191a5a..1c10dcb51c 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -235,11 +235,15 @@ def open_socket(path): sock =3D socket.socket() sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind((host, int(port))) + + # If given port was 0 the final port number is now available + path =3D '%s:%d' % sock.getsockname() else: sock =3D socket.socket(socket.AF_UNIX) sock.bind(path) sock.listen(0) print 'Listening on %s' % path + sys.stdout.flush() # another process may be waiting, show message now return sock =20 def usage(args): --=20 2.13.5 From nobody Sat May 4 20:50:21 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503588951994210.72438978676496; Thu, 24 Aug 2017 08:35:51 -0700 (PDT) Received: from localhost ([::1]:49062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkuAg-000672-G4 for importer@patchew.org; Thu, 24 Aug 2017 11:35:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dku9G-00057H-AB for qemu-devel@nongnu.org; Thu, 24 Aug 2017 11:34:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dku9B-0000Fi-JY for qemu-devel@nongnu.org; Thu, 24 Aug 2017 11:34:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dku97-0000DU-Bj; Thu, 24 Aug 2017 11:34:13 -0400 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 4DE1D5D687; Thu, 24 Aug 2017 15:34:12 +0000 (UTC) Received: from localhost (ovpn-116-96.ams2.redhat.com [10.36.116.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D4307E659; Thu, 24 Aug 2017 15:34:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4DE1D5D687 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=stefanha@redhat.com From: Stefan Hajnoczi To: Date: Thu, 24 Aug 2017 16:33:45 +0100 Message-Id: <20170824153345.2244-4-stefanha@redhat.com> In-Reply-To: <20170824153345.2244-1-stefanha@redhat.com> References: <20170824153345.2244-1-stefanha@redhat.com> 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.39]); Thu, 24 Aug 2017 15:34:12 +0000 (UTC) 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 3/3] qemu-iotests: test NBD over UNIX domain sockets in 083 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 , Paolo Bonzini , Stefan Hajnoczi , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 083 only tests TCP. Some failures might be specific to UNIX domain sockets. A few adjustments are necessary: 1. Generating a port number and waiting for server startup is TCP-specific. Use the new nbd-fault-injector.py startup protocol to fetch the address. This is a little more elegant because we don't need netstat anymore. 2. The NBD filter does not work for the UNIX domain sockets URIs we generate and must be extended. 3. Run all tests twice: once for TCP and once for UNIX domain sockets. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake --- tests/qemu-iotests/083 | 138 +++++++++++++++++++++++------------= -- tests/qemu-iotests/083.out | 145 ++++++++++++++++++++++++++++++++++-= ---- tests/qemu-iotests/common.filter | 4 +- 3 files changed, 215 insertions(+), 72 deletions(-) diff --git a/tests/qemu-iotests/083 b/tests/qemu-iotests/083 index bff9360048..0306f112da 100755 --- a/tests/qemu-iotests/083 +++ b/tests/qemu-iotests/083 @@ -27,6 +27,14 @@ echo "QA output created by $seq" here=3D`pwd` status=3D1 # failure is the default! =20 +_cleanup() +{ + rm -f nbd.sock + rm -f nbd-fault-injector.out + rm -f nbd-fault-injector.conf +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + # get standard environment, filters and checks . ./common.rc . ./common.filter @@ -35,81 +43,105 @@ _supported_fmt generic _supported_proto nbd _supported_os Linux =20 -# Pick a TCP port based on our pid. This way multiple instances of this t= est -# can run in parallel without conflicting. -choose_tcp_port() { - echo $((($$ % 31744) + 1024)) # 1024 <=3D port < 32768 -} - -wait_for_tcp_port() { - while ! (netstat --tcp --listening --numeric | \ - grep "$1.*0\\.0\\.0\\.0:\\*.*LISTEN") >/dev/null 2>&1; do - sleep 0.1 - done -} - check_disconnect() { + local event export_name=3Dfoo extra_args nbd_addr nbd_url proto when + + while true; do + case $1 in + --classic-negotiation) + shift + extra_args=3D--classic-negotiation + export_name=3D + ;; + --tcp) + shift + proto=3Dtcp + ;; + --unix) + shift + proto=3Dunix + ;; + *) + break + ;; + esac + done + event=3D$1 when=3D$2 - negotiation=3D$3 echo "=3D=3D=3D Check disconnect $when $event =3D=3D=3D" echo =20 - port=3D$(choose_tcp_port) - cat > "$TEST_DIR/nbd-fault-injector.conf" <"$TEST_DIR/nbd-fault-injector.out" 2>&1 & + + # Wait for server to be ready + while ! grep -q 'Listening on ' "$TEST_DIR/nbd-fault-injector.out"; do + sleep 0.1 + done + + # Extract the final address (port number has now been assigned in tcp cas= e) + nbd_addr=3D$(sed 's/Listening on \(.*\)$/\1/' "$TEST_DIR/nbd-fault-inject= or.out") + + if [ "$proto" =3D "tcp" ]; then + nbd_url=3D"nbd+tcp://$nbd_addr/$export_name" + else + nbd_url=3D"nbd+unix:///$export_name?socket=3D$nbd_addr" fi =20 - $PYTHON nbd-fault-injector.py $extra_args "127.0.0.1:$port" "$TEST_DIR/nb= d-fault-injector.conf" >/dev/null 2>&1 & - wait_for_tcp_port "127\\.0\\.0\\.1:$port" $QEMU_IO -c "read 0 512" "$nbd_url" 2>&1 | _filter_qemu_io | _filter_nbd =20 echo } =20 -for event in neg1 "export" neg2 request reply data; do - for when in before after; do - check_disconnect "$event" "$when" - done - - # Also inject short replies from the NBD server - case "$event" in - neg1) - for when in 8 16; do - check_disconnect "$event" "$when" - done - ;; - "export") - for when in 4 12 16; do - check_disconnect "$event" "$when" - done - ;; - neg2) - for when in 8 10; do - check_disconnect "$event" "$when" +for proto in tcp unix; do + for event in neg1 "export" neg2 request reply data; do + for when in before after; do + check_disconnect "--$proto" "$event" "$when" done - ;; - reply) - for when in 4 8; do - check_disconnect "$event" "$when" - done - ;; - esac -done =20 -# Also check classic negotiation without export information -for when in before 8 16 24 28 after; do - check_disconnect "neg-classic" "$when" --classic-negotiation + # Also inject short replies from the NBD server + case "$event" in + neg1) + for when in 8 16; do + check_disconnect "--$proto" "$event" "$when" + done + ;; + "export") + for when in 4 12 16; do + check_disconnect "--$proto" "$event" "$when" + done + ;; + neg2) + for when in 8 10; do + check_disconnect "--$proto" "$event" "$when" + done + ;; + reply) + for when in 4 8; do + check_disconnect "--$proto" "$event" "$when" + done + ;; + esac + done + + # Also check classic negotiation without export information + for when in before 8 16 24 28 after; do + check_disconnect "--$proto" --classic-negotiation "neg-classic" "$when" + done done =20 # success, all done diff --git a/tests/qemu-iotests/083.out b/tests/qemu-iotests/083.out index a24c6bfece..a7fb081889 100644 --- a/tests/qemu-iotests/083.out +++ b/tests/qemu-iotests/083.out @@ -1,43 +1,43 @@ QA output created by 083 =3D=3D=3D Check disconnect before neg1 =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect after neg1 =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect 8 neg1 =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect 16 neg1 =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect before export =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect after export =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect 4 export =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect 12 export =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect 16 export =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect before neg2 =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect after neg2 =3D=3D=3D =20 @@ -45,11 +45,11 @@ read failed: Input/output error =20 =3D=3D=3D Check disconnect 8 neg2 =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect 10 neg2 =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT:exportname=3Dfoo +can't open device nbd+tcp://127.0.0.1:PORT/foo =20 =3D=3D=3D Check disconnect before request =3D=3D=3D =20 @@ -88,23 +88,134 @@ read 512/512 bytes at offset 0 =20 =3D=3D=3D Check disconnect before neg-classic =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT +can't open device nbd+tcp://127.0.0.1:PORT/ =20 =3D=3D=3D Check disconnect 8 neg-classic =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT +can't open device nbd+tcp://127.0.0.1:PORT/ =20 =3D=3D=3D Check disconnect 16 neg-classic =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT +can't open device nbd+tcp://127.0.0.1:PORT/ =20 =3D=3D=3D Check disconnect 24 neg-classic =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT +can't open device nbd+tcp://127.0.0.1:PORT/ =20 =3D=3D=3D Check disconnect 28 neg-classic =3D=3D=3D =20 -can't open device nbd:127.0.0.1:PORT +can't open device nbd+tcp://127.0.0.1:PORT/ + +=3D=3D=3D Check disconnect after neg-classic =3D=3D=3D + +read failed: Input/output error + +=3D=3D=3D Check disconnect before neg1 =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect after neg1 =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 8 neg1 =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 16 neg1 =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect before export =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect after export =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 4 export =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 12 export =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 16 export =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect before neg2 =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect after neg2 =3D=3D=3D + +read failed: Input/output error + +=3D=3D=3D Check disconnect 8 neg2 =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 10 neg2 =3D=3D=3D + +can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect before request =3D=3D=3D + +read failed: Input/output error + +=3D=3D=3D Check disconnect after request =3D=3D=3D + +read failed: Input/output error + +=3D=3D=3D Check disconnect before reply =3D=3D=3D + +read failed: Input/output error + +=3D=3D=3D Check disconnect after reply =3D=3D=3D + +read failed: Input/output error + +=3D=3D=3D Check disconnect 4 reply =3D=3D=3D + +read failed +read failed: Input/output error + +=3D=3D=3D Check disconnect 8 reply =3D=3D=3D + +read failed +read failed: Input/output error + +=3D=3D=3D Check disconnect before data =3D=3D=3D + +read failed: Input/output error + +=3D=3D=3D Check disconnect after data =3D=3D=3D + +read 512/512 bytes at offset 0 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=3D=3D=3D Check disconnect before neg-classic =3D=3D=3D + +can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 8 neg-classic =3D=3D=3D + +can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 16 neg-classic =3D=3D=3D + +can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 24 neg-classic =3D=3D=3D + +can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock + +=3D=3D=3D Check disconnect 28 neg-classic =3D=3D=3D + +can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock =20 =3D=3D=3D Check disconnect after neg-classic =3D=3D=3D =20 diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 7a58e57317..9d5442ecd9 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -170,9 +170,9 @@ _filter_nbd() # # Filter out the TCP port number since this changes between runs. sed -e '/nbd\/.*\.c:/d' \ - -e 's#nbd:\(//\)\?127\.0\.0\.1:[0-9]*#nbd:\1127.0.0.1:PORT#g' \ + -e 's#127\.0\.0\.1:[0-9]*#127.0.0.1:PORT#g' \ -e "s#?socket=3D$TEST_DIR#?socket=3DTEST_DIR#g" \ - -e 's#\(exportname=3Dfoo\|PORT\): Failed to .*$#\1#' + -e 's#\(foo\|PORT/\?\|.sock\): Failed to .*$#\1#' } =20 # make sure this script returns success --=20 2.13.5