From nobody Sun Feb 8 19:55:41 2026 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.zoho.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 1496155166204411.1664679057254; Tue, 30 May 2017 07:39:26 -0700 (PDT) Received: from localhost ([::1]:54195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFiIu-0004kR-O8 for importer@patchew.org; Tue, 30 May 2017 10:39:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFiAp-0005QI-37 for qemu-devel@nongnu.org; Tue, 30 May 2017 10:31:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFiAm-0000QC-Sz for qemu-devel@nongnu.org; Tue, 30 May 2017 10:31:02 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:21678 helo=relay.sw.ru) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFiAm-0000NG-1M for qemu-devel@nongnu.org; Tue, 30 May 2017 10:31:00 -0400 Received: from kvm.sw.ru (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id v4UEUqER027829; Tue, 30 May 2017 17:30:55 +0300 (MSK) From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Date: Tue, 30 May 2017 17:30:44 +0300 Message-Id: <20170530143052.165002-12-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170530143052.165002-1-vsementsov@virtuozzo.com> References: <20170530143052.165002-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x [fuzzy] X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [PATCH 11/19] io/channel-socket: qio_channel_socket_writev handle EPIPE 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: pbonzini@redhat.com, vsementsov@virtuozzo.com, den@openvz.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" Return QIO_CHANNEL_ERR_EPIPE on EPIPE, we will need it to improve error path in nbd server. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/io/channel.h | 1 + io/channel-socket.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/io/channel.h b/include/io/channel.h index 5d48906998..5529c2da31 100644 --- a/include/io/channel.h +++ b/include/io/channel.h @@ -38,6 +38,7 @@ typedef struct QIOChannel QIOChannel; typedef struct QIOChannelClass QIOChannelClass; =20 #define QIO_CHANNEL_ERR_BLOCK -2 +#define QIO_CHANNEL_ERR_EPIPE -3 =20 typedef enum QIOChannelFeature QIOChannelFeature; =20 diff --git a/io/channel-socket.c b/io/channel-socket.c index 53386b7ba3..50f9f966c6 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -542,7 +542,7 @@ static ssize_t qio_channel_socket_writev(QIOChannel *io= c, } error_setg_errno(errp, errno, "Unable to write to socket"); - return -1; + return errno =3D=3D EPIPE ? QIO_CHANNEL_ERR_EPIPE : -1; } return ret; } --=20 2.11.1