From nobody Fri Oct 23 15:10:31 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=1792140221; cv=none; d=zohomail.com; s=zohoarc; b=kL/vxpo140fesRfqcQqjCoWlSwO+eOzkG622x/il4YI9/lu28KcWNh+xcnAEgNj75V7+UK/0DX84XWOZ8hTx5k7s+vjZcMZwZTmzfTFYMkpb6CLTG1SHbqYXHVDzolb/DOk5VvLAQlPPXHkQMbbnePQbcJRFDijuAIq3VPg4Kuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792140221; 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=WCrMLvdRzGDS7e4b9CIqXLUs8bUxJrJ0y+GX9OeG0MqmDawSAAVdMIKOsqhaogA0yoaBL6L0uCKeYM32xgEGvqwjfVgUvU4SreC9oY0zDN9kB/rw+my7etkmTfgWnDl3aRCJDP2MOU/edkOiG8uAKw+NisHSZW/8si0KDAyvu0E= 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 1792140221379819.6420073983912; Fri, 16 Oct 2026 01:43:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xHdWR-0005HX-EF; Fri, 16 Oct 2026 04:42:39 -0400 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 1xHdWM-0005Ga-6j; Fri, 16 Oct 2026 04:42:34 -0400 Received: from 2.mo15.mail-out.ovh.net ([5.135.90.179]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xHdWJ-0000fa-TS; Fri, 16 Oct 2026 04:42:33 -0400 Received: from DAGFR11EX3.OVH.local (unknown [10.109.254.243]) by mo15.mail-out.ovh.net (Postfix) with ESMTPS id 4j5djV6177z3y0C; Fri, 16 Oct 2026 08:42:22 +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.53; Fri, 16 Oct 2026 10:42:22 +0200 From: Guillaume Vincke To: CC: , Eric Blake , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , Guillaume Vincke Subject: [PATCH v2 1/2] nbd/client-connection: Fix client returning a closed channel Date: Fri, 16 Oct 2026 10:41:35 +0200 Message-ID: <20261016084136.233836-2-guillaume.vincke@ovhcloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261016084136.233836-1-guillaume.vincke@ovhcloud.com> References: <20261016084136.233836-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: 16388036094213570855 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: dmFkZTFQWFIasQWwgkcRHX+30LvtB4TZAVg1fsrA7T7lVwn4CHTDRSIX0O3imyPoZCSjpPjSg8ZonNEjcciV1rkWuhkRBqebwbKRn8B5Aqi6+Bo3JbPlJNbNJV5HiMfeX0RRoEBhBl/gVCCPAVkfGN6ksPSIzC8uoB3ez40EtDyluuxQ/8XKJpcKy8Mheg1n1w+YqbMbrd49oj7mkGUJZEiSrgc8QrVGxnKpZLAFF8fi+BVId9Modl3fQwmfrnzRJg8pajcdKoBAMLXb+ZQC5A+JT8XVDRrUhB7x5dqOMv+0B6ar3EjdMHjhN3hYAzARm83XbImcRt58AUJw9UT89BdOlQOFo6dufizF2KDbqexKHpRBSeRu0gHWy3fwnfbR4CQpd3yHI52R/lU0sW8iMHPqSgNTpROMD8B2QbBRLbVe2+7C4HR04uxldmFkRjpwhhtDvy2w9UO8GSSr8fmgVRdRDXnXHWvXb4IaWT/+lN1mkVSqTcU5PVJl1nZv7yiGwXXXwxfc+9DGfeA5tIMscxfbtFv43A7BMkA8IMVSGuvgDBNgr8rNiCGLJ4VMKQ8KN0zFr7uJ1K2gFAqmzHCqtKzTJFfQf5QwwKK+GxfJ89V07UCY8fmYzEQ+CN36gZfsoO0xOegxcV4H9SdfyXfF2mDzkHtuios1pDvAvuZ8GrkAT7wp9g DKIM-Signature: a=rsa-sha256; bh=US8NJbCfg9WNF2BgSiZJeNvLqjLRNqts6mdflstllps=; c=relaxed/relaxed; d=ovhcloud.com; h=From; s=mailout; t=1792140143; v=1; b=ErTO6lle33Tsza4WHo8cnMR2Z01Gw5Gl7B+ue0FQB/YpMhwq2/g+yzY1h+6GpYXjb7csnuhr UUE3mMvEs42MJRMTley9H5iFUwtn0p51SRXjyWm7hmKWC0TfDbug6Hou+4wTnfufem9OE/uy6LL ngpLTs8cfh+ndJ6hua/fGACw= 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.179; envelope-from=guillaume.vincke@ovhcloud.com; helo=2.mo15.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, RCVD_IN_MSPIKE_H2=0.001, 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: 1792140223482158500 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 Oct 23 15:10:31 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=1792140227; cv=none; d=zohomail.com; s=zohoarc; b=QrIW75hZLbfkGUimrQX5qriFy1TQWb3W6OYk6I0SzKPWsTEjPPAVNaniXLlGA0tMiF9kS9WWQCCXPjN0mjzeIPrM3qlBBiH2+1uIQgHOqWPJ+sOTfPD/lvzLxd3n6on4AUzaqoKey73/Cbko/7enM7NHZvqg8GA6u1lja+ArZV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792140227; 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=Z2TVfZv4uJoBfAMcWXQuY/FuSvZLluiwmx74h49HcWg=; b=MqlESunFHnSJ69y9jX8cYEtwzafp2gNkGXnHoR476wcWerINqYL+DL+11Aa3iUS49fJdpwcLcb4Tx77VjJk5wqu8SUNi+0WhP3aOXxnrPeFsrMTBlwyARHZfHkvFlYLCFQ4symk4NXsc1NJmF+3l+GWkDQHD83fjdHApjXXJ1pM= 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 1792140227016420.1527940545526; Fri, 16 Oct 2026 01:43:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xHdWV-0005Ir-Dr; Fri, 16 Oct 2026 04:42:43 -0400 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 1xHdWO-0005H4-OU; Fri, 16 Oct 2026 04:42:38 -0400 Received: from 2.mo508.mail-out.ovh.net ([5.135.90.177]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xHdWL-0000fh-RH; Fri, 16 Oct 2026 04:42:35 -0400 Received: from DAGFR11EX3.OVH.local (unknown [10.110.37.6]) by mo508.mail-out.ovh.net (Postfix) with ESMTPS id 4j5djX3fp8z7tD1; Fri, 16 Oct 2026 08:42:24 +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.53; Fri, 16 Oct 2026 10:42:23 +0200 From: Guillaume Vincke To: CC: , Eric Blake , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz , Guillaume Vincke Subject: [PATCH v2 2/2] iotests: Add coverage for NBD connect thread start delay Date: Fri, 16 Oct 2026 10:41:36 +0200 Message-ID: <20261016084136.233836-3-guillaume.vincke@ovhcloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261016084136.233836-1-guillaume.vincke@ovhcloud.com> References: <20261016084136.233836-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: 16388599046724272423 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: dmFkZTGgKVQVIISAQ/CNeJ4qfsKEqEyBvKiNTCKxTTMmCLp33jNUWdKVIJB6ih68uuhRIwgx1mpUuqPWupeuVi+K4gmAZuDhHul8VJ1RR/ckUoLmpttBuurbj9jOYmtM7psZ7L5nm3KCHdo3PKcP43IW903w8KWJPV61cGYVcB2MYZOIVODzFWxpVHTLzUxg02KUJ3YTQmL3C6QGcRFqmrgpG/MdJyNXrr+WtHt/1V31rAxtGb+nuwfIPt2HTU728jXRBEaGAVITpfLlryCiFrk76HKtAzWn4HU05s8segvV6ySKExkd/Do8GezPN26QaSSDHPnX8hOpRDnLYBBi0XLxsk3Xm51EkklEAGnvbva6BHEcA5KNOuMyHMlW6PCA0xgm8OYylX5+yDpepD3RrCK/x/ZbAQYE0s/fCXVVnM8VCD7IkoqRGry8brDb2gIAUeblNQNjvrmBXOPVSoJN1aIB2meH5uQp/pE//vTc8SpY5Y8P5YV2VmxYomHB0db0Fp8aaUaUElnmgZvkIotFwCJLf2zhz2rQKMAGVg5GOZY8m3/pZM1AMk0AJnQaYjFkdaA/G9HFm/eh9PB29TnG1wM2/xeBEtTDNe9zmuy5XZjpVe+jsZqa/EElvaZ2xUjwDs9+vev6BP/32AyvErxg8K7RSCvaCnDF71WZZzm0q/yxwKU/kA DKIM-Signature: a=rsa-sha256; bh=Z2TVfZv4uJoBfAMcWXQuY/FuSvZLluiwmx74h49HcWg=; c=relaxed/relaxed; d=ovhcloud.com; h=From; s=mailout; t=1792140144; v=1; b=S/wWqAf0xscKINInfpNnJcqwqUNoZivIO2ZJCUs+TH0dNrCDbUiAHc9lX9ILBnWXf+mEDry3 pfjmIILctMG9OogQxoBlSltoSV0oHCmYz0bjiq5rqKfqDT1tlt4toJhS8kOG1h9d97uRFVF+iaH /fzeXPftXdKBxovCEbDaurE4= 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.177; envelope-from=guillaume.vincke@ovhcloud.com; helo=2.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: 1792140229736158500 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 --- 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..09e00d8b3e --- /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() +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