From nobody Fri Nov 13 01:12:39 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=quarantine dis=none) header.from=ovhcloud.com ARC-Seal: i=1; a=rsa-sha256; t=1793896969; cv=none; d=zohomail.com; s=zohoarc; b=DqNw7XGr6+aDNIAV+mNjjmIpfCZqAsbkgzS1iRsD7/BwPPdYgGeIg5oeDOX2Th9gkPdFwNegrYZ2tu0XT4h9MHmQbottqYj/BIAF3qKxVDpmH115+3a/GE7+SvL70JP9IP7pK7sJGPx332KGeUvvsCEtpW0MWbaZxHRVNoRo2H8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793896969; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=US8NJbCfg9WNF2BgSiZJeNvLqjLRNqts6mdflstllps=; b=KouMIk58CV0t9B/D9BOpfgOgYkx0ei0cocGj/aOYgiMjSMZ0gAntW4hP7DZM4J1n0pEE4IusHdr/nrG3Z27wSBHRpGyyZkOYcQGu7jlIJZ/g5TAb8/j9jXL77gBRfiEzV/sPA0CdMjNtlhY0QqZ6jJjxXNruKIvHP7YYuCjKpqI= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793896969191913.1868798423342; Thu, 5 Nov 2026 08:42:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xP0XT-0007vP-G7; Thu, 05 Nov 2026 11:42:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xP0XM-0007uu-Sp for qemu-devel@nongnu.org; Thu, 05 Nov 2026 11:42:05 -0500 Received: from 1.mo508.mail-out.ovh.net ([5.135.90.176]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xP0XJ-00029j-Jx for qemu-devel@nongnu.org; Thu, 05 Nov 2026 11:42:04 -0500 Received: from DAGFR11EX3.OVH.local (unknown [10.109.249.23]) by mo508.mail-out.ovh.net (Postfix) with ESMTPS id 4jL7Pd2skgz7tBr; Thu, 5 Nov 2026 16:41:57 +0000 (UTC) Received: from ovhcloud.com (109.190.254.61) by DAGFR11EX3.OVH.local (172.16.2.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Thu, 5 Nov 2026 17:41:56 +0100 From: Guillaume Vincke To: CC: , Eric Blake , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , Guillaume Vincke Subject: [PATCH v3 1/2] nbd/client-connection: Fix client returning a closed channel Date: Thu, 5 Nov 2026 17:41:23 +0100 Message-ID: <20261105164124.249395-2-guillaume.vincke@ovhcloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261105164124.249395-1-guillaume.vincke@ovhcloud.com> References: <20261105164124.249395-1-guillaume.vincke@ovhcloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [109.190.254.61] X-ClientProxiedBy: CAS4.OVH.local (172.16.1.4) To DAGFR11EX3.OVH.local (172.16.2.113) X-OVH-CORPLIMIT-SKIP: true x-ovh-tracer-id: 12814148314911097127 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: dmFkZTEn9tFPusAA5Q4MqpjZoNzci9VQHLzLko0uQkRTM2DlaAFbwRwjsWYA3SgYuzW9N0fjh4Sfl6p/cqpgLJGf5atzEkfGH8mA7lwLEQeTYGX8Mzyt6Vth5v7GzqtsPvNY8hJmw7I1UHjbL9Wxati8Vbf3SShIjOIPnoKX50VnJJSJcPI7onvv6Oy1NjSye3oA9/gWuiSedOpPcYYW9IXyEmO7L6cHdETzxgAKwThIwZx+JRN1edq71TOWsfeNkaVsxkyjN/1CrJ1M+Pnidq9dUoYmc62gSu9siwv/eRHmy9W1CHJVcVoysXgZ38MyYSpuHxjzw0Xj50ErHGzKgN1XGuYMU0rYfMw3Yle/psUs/4jlqaXb+oL7UzXXicbSA0A9js7YzT2Q7dhaXW6pJMX96nJKCQexs7Mpbq7tsIkXjDJ0HxII2B2T7mc/9dwixdrS2PSVcKzdpjA5wvz193uFNLHymoSF5RfLGuVD3pNDzWh8eYW9rtv9NJZsHd19v2HnHbZibfkT3VriwcYnfNDF1xInhCoipdKWe0JiBwA8DyULCutKwQ3GqAurQsNMojuN5Rl+CbMmgcHYnGTBu42C7I1v234aWp7VE8THV5ZLQz4q41Iv6o/LW+nNFeGjTOt3SoII0LahSxjnAwVRdn24uvzDyozX4JhMryYSliWBrFmHJA DKIM-Signature: a=rsa-sha256; bh=US8NJbCfg9WNF2BgSiZJeNvLqjLRNqts6mdflstllps=; c=relaxed/relaxed; d=ovhcloud.com; h=From; s=mailout; t=1793896918; v=1; b=c3EBXAKZhNBURQKDnNatecBb99ctgvMtaNR9vVJ8RptUNyv033Ft8dF93D95U+nVKPRJ8399 zRj23sjiWF70OawNyBCH4MWnvuNvXotsuuasStMF41uO1zzvmGzcseWVu+p/C7PTzFCDztDSBrT 397F6ePRJ5GpfkDmqJBscZEs= 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=lists1p.gnu.org; Received-SPF: pass client-ip=5.135.90.176; envelope-from=guillaume.vincke@ovhcloud.com; helo=1.mo508.mail-out.ovh.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: guillaume.vincke@ovhcloud.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ovhcloud.com) X-ZM-MESSAGEID: 1793896971635158501 Content-Type: text/plain; charset="utf-8" When a server closes the connection after a successful handshake but before running any operations, the channel returned by nbd_co_establish_connection() is the closed one and the connect thread is not started. When configured with reconnect-delay=3D0 (the default), this situation generates at least two IO errors. The first one happens when trying to issue an operation to the closed socket. The connect thread will be started on the next request, which may happen long after, and will create the second error as nbd_co_establish_connection() returns a NULL channel. Peeking the channel to detect FIN or RST avoids the first IO error and does not delay the starting of the connect thread. Signed-off-by: Guillaume Vincke Reviewed-by: Eric Blake --- nbd/client-connection.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/nbd/client-connection.c b/nbd/client-connection.c index 6a4f080717..aec62934d1 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -274,6 +274,23 @@ void nbd_client_connection_release(NBDClientConnection= *conn) } } =20 +/* Only true when the peer closed the channel. Does not detect if dead. */ +static bool nbd_channel_is_closed(QIOChannel *ioc) +{ + char data; + struct iovec iov =3D { .iov_base =3D &data, .iov_len =3D 1 }; + ssize_t len =3D -1; + + if (!qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_READ_MSG_PEEK)) { + return false; + } + + len =3D qio_channel_readv_full( + ioc, &iov, 1, NULL, NULL, QIO_CHANNEL_READ_FLAG_MSG_PEEK, NULL); + + return len =3D=3D 0 || (len < 0 && len !=3D QIO_CHANNEL_ERR_BLOCK); +} + /* * Get a new connection in context of @conn: * if the thread is running, wait for completion @@ -295,6 +312,7 @@ nbd_co_establish_connection(NBDClientConnection *conn, = NBDExportInfo *info, bool blocking, Error **errp) { QemuThread thread; + QIOChannel *ioc; =20 if (conn->do_negotiation) { assert(info); @@ -308,6 +326,20 @@ nbd_co_establish_connection(NBDClientConnection *conn,= NBDExportInfo *info, assert(!conn->wait_co); =20 if (!conn->running) { + if (conn->sioc) { + /* discard if the socket got closed by its peer */ + ioc =3D QIO_CHANNEL(conn->sioc); + if (!qio_channel_set_blocking(ioc, false, NULL) || + nbd_channel_is_closed(ioc)) { + + qio_channel_close(ioc, NULL); + object_unref(OBJECT(conn->sioc)); + conn->sioc =3D NULL; + object_unref(OBJECT(conn->ioc)); + conn->ioc =3D NULL; + } + } + if (conn->sioc) { /* Previous attempt finally succeeded in background */ if (conn->do_negotiation) { --=20 2.43.0 From nobody Fri Nov 13 01:12:39 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=quarantine dis=none) header.from=ovhcloud.com ARC-Seal: i=1; a=rsa-sha256; t=1793896970; cv=none; d=zohomail.com; s=zohoarc; b=Vig/u2onvoDg8gl7bHkKELyREXCEoEGW5vF2eozNX4v7sDlsNSxlt8g+xC3V8BEqG17yZFLAjYXGOCB0t3SujVDgquQoOl56uDwtpjrSNMpggubHzRmE1mcs247vdOdbm9v/KC17+2eu4Ul+tIISt/HuQKqicm6FBVJlFcrEKrA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793896970; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=kS4jIRriSQDC9LhEc27uEKkT6kKs3DmfEVsBCVntYYA=; b=JPQjW3LNTlPAr8biya/1lNo6dOkC57n1HyNgivw31GHuRwpBs1ijElTcbWvHfmaaggU9R1mUIFce6wM4omkbWLmhT7VTCNF4cey8VY5ATtQ1HUNDzmHTVtNMxyoi+vn4h1qSQaLbTOHTpiY+u16YffokrDbWNYVK8ji5rvvKnMI= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793896969932148.1777940396256; Thu, 5 Nov 2026 08:42:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xP0Xc-0007x4-4e; Thu, 05 Nov 2026 11:42:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xP0XU-0007vy-Gu for qemu-devel@nongnu.org; Thu, 05 Nov 2026 11:42:14 -0500 Received: from 1.mo508.mail-out.ovh.net ([5.135.90.176]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xP0XQ-00029p-Ea for qemu-devel@nongnu.org; Thu, 05 Nov 2026 11:42:10 -0500 Received: from DAGFR11EX3.OVH.local (unknown [10.110.0.161]) by mo508.mail-out.ovh.net (Postfix) with ESMTPS id 4jL7Pf58FYz7tDf; Thu, 5 Nov 2026 16:41:58 +0000 (UTC) Received: from ovhcloud.com (109.190.254.61) by DAGFR11EX3.OVH.local (172.16.2.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Thu, 5 Nov 2026 17:41:58 +0100 From: Guillaume Vincke To: CC: , Eric Blake , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , Guillaume Vincke Subject: [PATCH v3 2/2] iotests: Add coverage for NBD connect thread start delay Date: Thu, 5 Nov 2026 17:41:24 +0100 Message-ID: <20261105164124.249395-3-guillaume.vincke@ovhcloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261105164124.249395-1-guillaume.vincke@ovhcloud.com> References: <20261105164124.249395-1-guillaume.vincke@ovhcloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [109.190.254.61] X-ClientProxiedBy: CAS4.OVH.local (172.16.1.4) To DAGFR11EX3.OVH.local (172.16.2.113) X-OVH-CORPLIMIT-SKIP: true x-ovh-tracer-id: 12814429793129546023 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: dmFkZTEn9tFPusAA5Q4MqpjZoNzci9VQHLzLko0uQkRTM2DlaAFbwRwjsWYA3SgYuzW9N0fjh4Sfl6p/cqpgLJGf5atzEkfGH8mA7lwLEQeTYGX8Mzyt6Vth5v7GzqtsPvNY8hJmw7I1UHjbL9Wxati8Vbf3SShIjOIPnoKX50VnJJSJcPI7onvv6Oy1NjSye3oA9/gWuiSedOpPcYYW9IXyEmO7L6cHdETzxgAKwThIwZx+JRN1edq71TOWsfeNkaVsxkyjN/1CrJ1M+Pnidq9dUoYmc62gSu9siwv/eRHmy9W1CHJVcVoysXgZ38MyYSpuHxjzw0Xj50ErHGzKgN1XGuYMHjoFGRbN2o2+AejSj/sfgt6H5kAN7KMT/HtEWuLComVMR3YxVqcs/jA4+Otfy/FFZKZ/Cq81WpLzyUSclsgKlLmjhnT/seZB5QWEXTIjId9cfB1CwynuivOEx3Dv9n/3ULqbgrhBLkV9bxVW7jjhUPiaQe5keh/IvuiLU4lfSCtJTqKXeVIDpC7pvf8c+tkaczfiUyzl2w1x8tQnPL+c0ykWiLqHwV6AyjqnvHWQnRc7OEzyODdQ23uT2hmMM7Pxw6JrWt0yPjNesHuebh/E4d9NLcJSAkl7ts8sHMQVy2gpRrqFqDTi7XlH9i1Sku+tanzIMNqWaQoZDmJYZee41w DKIM-Signature: a=rsa-sha256; bh=kS4jIRriSQDC9LhEc27uEKkT6kKs3DmfEVsBCVntYYA=; c=relaxed/relaxed; d=ovhcloud.com; h=From; s=mailout; t=1793896918; v=1; b=TnIgQ+WnMgb9d4BArvW6HIDIRm2ewZ9Xjkj/+w+IdD64R/pJ3IfgqjQIzoRZVxsVkSAQKMlO bg70NCCvOM9z9wSx0uinV9RPTTi0+DvFkBDvnVGlju+hEdtU8AyG5lIg/KY+NT5Jl39ePcm6zO3 cqbNmDYIRktXEUffjqVvccIE= 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=lists1p.gnu.org; Received-SPF: pass client-ip=5.135.90.176; envelope-from=guillaume.vincke@ovhcloud.com; helo=1.mo508.mail-out.ovh.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: guillaume.vincke@ovhcloud.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ovhcloud.com) X-ZM-MESSAGEID: 1793896973573158500 Content-Type: text/plain; charset="utf-8" Test the connect thread starting condition with reconnect-delay=3D0 when the server disconnects after a successful handshake but before running operations. Prior to the change to nbd_co_establish_connection(), this test would demonstrate two I/O errors. The tests 264 and 277 covering reconnection do not use reconnect-delay=3D0 so this case is not exercised. Add a test that provokes multiple errors in order to put an NBD client in the above-mentioned situation and shows that the first operation starts the connect thread and leads to successful subsequent I/O. Signed-off-by: Guillaume Vincke Reviewed-by: Eric Blake --- tests/qemu-iotests/tests/nbd-stale-connection | 60 +++++++++++++++++++ .../tests/nbd-stale-connection.out | 17 ++++++ 2 files changed, 77 insertions(+) create mode 100755 tests/qemu-iotests/tests/nbd-stale-connection create mode 100644 tests/qemu-iotests/tests/nbd-stale-connection.out diff --git a/tests/qemu-iotests/tests/nbd-stale-connection b/tests/qemu-iot= ests/tests/nbd-stale-connection new file mode 100755 index 0000000000..e361bccfa9 --- /dev/null +++ b/tests/qemu-iotests/tests/nbd-stale-connection @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +# group: quick +# +# Test the NBD client stale channel discard +# +# Copyright (C) 2026 OVHcloud +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import time +import iotests +from iotests import qemu_nbd_popen, qemu_img_create, file_path, log + + +# estimated duration required by the connect thread to reach a running ser= ver +MAX_NBD_CONNECT_DURATION =3D 1 + +iotests.script_initialize(supported_fmts=3D['qcow2']) +nbd_sock =3D file_path('nbd-sock', base_dir=3Diotests.sock_dir) +disk =3D file_path('disk') +qemu_img_create('-f', iotests.imgfmt, disk, '1M') + +with iotests.VM() as vm: + + vm.launch() + + with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk): + vm.cmd('blockdev-add', { + 'driver': 'nbd', + 'node-name': 'nbd0', + 'server': {'type': 'unix', 'path': nbd_sock}, + }) + iotests.log('=3D=3D=3D NBD Device connected =3D=3D=3D') + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a = 0 64k')) + + iotests.log('=3D=3D=3D NBD server down. Detect the break and start the= connect ' + 'thread =3D=3D=3D') + # client was in CONNECTED state a new operation updates to CONNECTING + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a 0 64= k')) + + with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk): + iotests.log('=3D=3D=3D NBD server up. Wait for the connect thread = to park ' + 'the channel =3D=3D=3D') + # in CONNECTING, the operation starts the connect thread + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a = 0 64k')) + # wait for the connect thread to get a new channel and stop + time.sleep(MAX_NBD_CONNECT_DURATION) + + iotests.log('=3D=3D=3D NBD server down. The parked channel is closed = =3D=3D=3D') + + with qemu_nbd_popen('-k', nbd_sock, '-f', iotests.imgfmt, disk): + iotests.log('=3D=3D=3D NBD server up. Restart the connect thread = =3D=3D=3D') + # operation will determine that the channel got closed and restart= the + # connect thread + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a = 0 64k')) + # Wait for it to succeed + iotests.log('=3D=3D=3D Wait for the connect thread to park the new= channel. ' + 'Subsequent operations are successful =3D=3D=3D') + time.sleep(MAX_NBD_CONNECT_DURATION) + log(vm.qmp('x-qemu-io', device=3D'nbd0', command=3D'write -P 0x5a = 0 64k')) diff --git a/tests/qemu-iotests/tests/nbd-stale-connection.out b/tests/qemu= -iotests/tests/nbd-stale-connection.out new file mode 100644 index 0000000000..065ba329e9 --- /dev/null +++ b/tests/qemu-iotests/tests/nbd-stale-connection.out @@ -0,0 +1,17 @@ +Start NBD server +=3D=3D=3D NBD Device connected =3D=3D=3D +{"return": {}} +Kill NBD server +=3D=3D=3D NBD server down. Detect the break and start the connect thread = =3D=3D=3D +{"error": {"class": "GenericError", "desc": "write failed: Input/output er= ror"}} +Start NBD server +=3D=3D=3D NBD server up. Wait for the connect thread to park the channel = =3D=3D=3D +{"error": {"class": "GenericError", "desc": "write failed: Input/output er= ror"}} +Kill NBD server +=3D=3D=3D NBD server down. The parked channel is closed =3D=3D=3D +Start NBD server +=3D=3D=3D NBD server up. Restart the connect thread =3D=3D=3D +{"error": {"class": "GenericError", "desc": "write failed: Input/output er= ror"}} +=3D=3D=3D Wait for the connect thread to park the new channel. Subsequent = operations are successful =3D=3D=3D +{"return": {}} +Kill NBD server --=20 2.43.0