From nobody Sat Sep 26 19:16:12 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=1790352768; cv=none; d=zohomail.com; s=zohoarc; b=Q9QXaBOCahMnQZKYVb62JIIQxNmTbLonK1R/4CJgReQNIkt76TUaZeMbgO1xbgmcoEd06PlF4x53Otps77EwRSGvGcKattjwNcpljLsWHW1xo1px59bBrQ6O8QCQkrBi4vpiHOgTSGVpIIuq6eg4gJTHIssCFy1zWaYIlpscBvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790352768; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c/b8KK6NZUiSNY5f9XgjrpPC0lZfNPNTGxt/ZcXT3mU=; b=BQGp5HqtwZK2Row21FeFOKtqZJPKK+99rW291eKFi2dJMeUz1ke57mY8EmaW17ysfMeveQ0z9WQku7SFDW041A6tERzu5EFPiCXPWbMuuATkxNyuz37SOl1d42I5Cm2jsLBekp3ZuZcpR4Ip2krpH84t4iJ3IlxehxWnmyDL1rg= 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 1790352767962897.4889785556177; Fri, 25 Sep 2026 09:12:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA8V1-0001qE-3G; Fri, 25 Sep 2026 12:10:12 -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 1xA8Ft-0000EM-Nv; Fri, 25 Sep 2026 11:54: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 1xA8Fp-00067R-Ce; Fri, 25 Sep 2026 11:54:32 -0400 Received: from DAGFR11EX3.OVH.local (unknown [10.110.43.115]) by mo15.mail-out.ovh.net (Postfix) with ESMTPS id 4hrwHW1CQbz3wp7; Fri, 25 Sep 2026 15:54:15 +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.49; Fri, 25 Sep 2026 17:54:13 +0200 From: Guillaume Vincke To: CC: , Eric Blake , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz Subject: [PATCH 1/2] nbd/client-connection: Fix client returning a closed channel Date: Fri, 25 Sep 2026 17:53:45 +0200 Message-ID: <20260925155346.357703-2-guillaume.vincke@ovhcloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260925155346.357703-1-guillaume.vincke@ovhcloud.com> References: <20260925155346.357703-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: 11035789415831191847 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: dmFkZTET5RUJGNfmJ9NTrJITjXYbdcTO3CD1/irQgvmbcVvU+j3yU3NLNdBQmSWzUyxGftnAL5Iois3+qtj5G+XGi6yJapT3529pc59sfOOCq/Kc8FQqT0XQF2xXbKMW9Wi/PJNlpjMFYJCk+XKL+8KSXvAiIysT66Iz/ljKq0uOHOb4fy1muOGETRnXuHRDQlP5guWfSG0NaIpQ2MvLi/625mPQwXHSmLKChwuCT5l8HPUupqfW4YfVcoXdGds9cFNYInZ9eTzaLkTVa9NMU6N55UkVhVs1pX/lFlbzKKFdmuYQ7LC7KFt6l3jwirOWNNA0XHCtZueAPaQvk4ugL/EC2Ybessk4iZdJyM4kj0LVGZxyt6b/vAlnclParS91v/L68acsYwQQ3Rl8NA9EskWg7wcXzNCZQgR3lQCc9U1Q5KBX10qK0wxsS4grI0+aHtp28WBiaotM2121hUueftkSkXHHGA9k7XqBeHKSWs4zKG5nYBdzTpWvKoRT04XPVjXf0TVdXLzwI+I/bUqMu/JAj1q+6wyHWq0xv1+YJqKUnAo+dxeORxN+CxpC9rDjQsAcRTKvbWrh0dB6D8K0Sl6hCwFrFd2knOKIfv1Rj45r+EWlolc5aa5qv6WIKHpjfya1yJ0PaoasSnWd6orkgjpj9bNB3kpkOWy4+s1pyG/pZ3zwOg DKIM-Signature: a=rsa-sha256; bh=c/b8KK6NZUiSNY5f9XgjrpPC0lZfNPNTGxt/ZcXT3mU=; c=relaxed/relaxed; d=ovhcloud.com; h=From; s=mailout; t=1790351655; v=1; b=fK7880b5SwVIYkPP+IPsuINon9dWE7Lvxw3FUAewHzSoqrZ64mJkiGqRwv+LgAYGrYSUInm+ hRrbzkXv6I0KFHsUrqhpwXc0d5ArP8qJNTNeTqihRMpGcahIWrAGGkeYwklxDbnnHHR2UBiJ1pj tQPzGuEMdjqWiBbwE/q9CIxU= 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 25 Sep 2026 12:05:02 -0400 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: , 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: 1790352771494158500 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 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/nbd/client-connection.c b/nbd/client-connection.c index 6a4f080717..878219fede 100644 --- a/nbd/client-connection.c +++ b/nbd/client-connection.c @@ -274,6 +274,26 @@ 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); + + if (len =3D=3D 0 || (len < 0 && len !=3D QIO_CHANNEL_ERR_BLOCK)) { + return true; + } + return false; +} + /* * Get a new connection in context of @conn: * if the thread is running, wait for completion @@ -295,6 +315,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 +329,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 Sat Sep 26 19:16:12 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=1790352407; cv=none; d=zohomail.com; s=zohoarc; b=O/UCyLWflhXiqq1r1qRE4hFF5cAeLaZnChBYSih9ZwkEqNt2Gdeba4memUcIYRJy1TY9vAD1YlrgdXqphwb3cNv/L0YQ5XCJcybEP7+pQ51xcQvVL/XrO3ygdV1VyE9vLSDtRam5Os25hu0LVfVxVewGpuGcK8hrCfdTpSK7R2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790352407; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=366bXCSEca/MypXuX5DsaXF8rVnjw5CHK4WfDSFcpbg=; b=CxIHXk8d8RRS3GrrvQUEpYyqM1TJpAj2zLhC2lIDrJ65F2IeYajiJDNY3ilo/jt0sSIEtXM0KhZQgpCJP27SvLFDkaPtu6bGrWj+xGDMRdM6vDw/66REEOHiiCbErJOi8pUrJGwSrVWwxYmtxQB9TZRV/80+q53IkN3pKkn4t9s= 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 1790352407111592.9722200132967; Fri, 25 Sep 2026 09:06:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xA8RS-0006XO-GZ; Fri, 25 Sep 2026 12:06:34 -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 1xA8Ft-0000EL-Nu for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:54: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 1xA8Fp-00067V-2g for qemu-devel@nongnu.org; Fri, 25 Sep 2026 11:54:33 -0400 Received: from DAGFR11EX3.OVH.local (unknown [10.110.43.115]) by mo15.mail-out.ovh.net (Postfix) with ESMTPS id 4hrwHW3V0Fz3wwW; Fri, 25 Sep 2026 15:54:15 +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.49; Fri, 25 Sep 2026 17:54:14 +0200 From: Guillaume Vincke To: CC: , Eric Blake , Vladimir Sementsov-Ogievskiy , Kevin Wolf , Hanna Reitz Subject: [PATCH 2/2] iotests: Add coverage for NBD connect thread start delay Date: Fri, 25 Sep 2026 17:53:46 +0200 Message-ID: <20260925155346.357703-3-guillaume.vincke@ovhcloud.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260925155346.357703-1-guillaume.vincke@ovhcloud.com> References: <20260925155346.357703-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: 11035789415208337703 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: dmFkZTET5RUJGNfmJ9NTrJITjXYbdcTO3CD1/irQgvmbcVvU+j3yU3NLNdBQmSWzUyxGftnAL5Iois3+qtj5G+XGi6yJapT3529pc59sfOOCq/Kc8FQqT0XQF2xXbKMW9Wi/PJNlpjMFYJCk+XKL+8KSXvAiIysT66Iz/ljKq0uOHOb4fy1muOGETRnXuHRDQlP5guWfSG0NaIpQ2MvLi/625mPQwXHSmLKChwuCT5l8HPUupqfW4YfVcoXdGds9cFNYInZ9eTzaLkTVa9NMU6N55UkVhVs1pX/lFlbzKKFdmuYQ7LC7KFt6l3jwirOWNNA0XHCtZueAPaQvk4ugL/EC2Ybessk4iZdJyM4kj0LVGZxyt6b/vAlnclParS91v/L68acsYwQQ3Rl8NA9EskWg7wcXzNCZQgR3lQCc9U1Q5KBX10qK0wxsS4grI0+aHtp28WBiaotM2121hUueftkSkXHHGA9k7XqBeHKSWs4zKG5nYBdzTpWvKoRT04XPVjXf0TVdXLzwI+I/bUqMu/JAj1q+6wyHWq0xv1+YJqKUnAo+dxeORxN+CxpC9rDjQsAcRTKvbWrh0dB6D8K0Sl6hCwFrFd2knOKIfv1Rj45r+EWlolc5aa5qv6WIKHpjfya1yJ0PaoasSnWd6orkgjpj9bNB3kpkOWy4+s1pyG/pZ3zwOg DKIM-Signature: a=rsa-sha256; bh=366bXCSEca/MypXuX5DsaXF8rVnjw5CHK4WfDSFcpbg=; c=relaxed/relaxed; d=ovhcloud.com; h=From; s=mailout; t=1790351655; v=1; b=MLPd4GwTafQOE3CxzyxwdIUJQ8zqNDet1CtfnsXA2PQ2yKMD2pRnxNHyr5c3y8YwrfZ1udjg 19ZPxqzExoOT2qSJoSLuagMTUz+aaGfstUEOrHsQF7MJRRnFlh4sF9Ds62OLxujKqOlE1d72dtf NLiNesNPhBwihcfcKAIFqhvA= 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 25 Sep 2026 12:05:02 -0400 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: , 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: 1790352409838158500 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 | 62 +++++++++++++++++++ .../tests/nbd-stale-connection.out | 17 +++++ 2 files changed, 79 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..6f6fb6ef1b --- /dev/null +++ b/tests/qemu-iotests/tests/nbd-stale-connection @@ -0,0 +1,62 @@ +#!/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_HANDSHAKE_DURATION =3D 0.5 +# sleep duration of the connection retry in nbd client +CONNECT_RETRY_DELAY =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')) + # in CONNECTING, the operation starts the connect thread + 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') + # wait for the connect thread to get a new channel and stop + time.sleep(CONNECT_RETRY_DELAY + MAX_NBD_HANDSHAKE_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_HANDSHAKE_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..50f80e2305 --- /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"}} +{"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 +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