From nobody Sun Feb 8 23:05:09 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 1496415948459826.2373745591389; Fri, 2 Jun 2017 08:05:48 -0700 (PDT) Received: from localhost ([::1]:50184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGo94-0004Vt-1u for importer@patchew.org; Fri, 02 Jun 2017 11:05:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGo5Q-0001FW-I8 for qemu-devel@nongnu.org; Fri, 02 Jun 2017 11:02:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGo5L-0002fi-KC for qemu-devel@nongnu.org; Fri, 02 Jun 2017 11:02:00 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:38463 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 1dGo5L-0002ed-9H for qemu-devel@nongnu.org; Fri, 02 Jun 2017 11:01:55 -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 v52F1ocx008525; Fri, 2 Jun 2017 18:01:52 +0300 (MSK) From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Date: Fri, 2 Jun 2017 18:01:44 +0300 Message-Id: <20170602150150.258222-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170602150150.258222-1-vsementsov@virtuozzo.com> References: <20170602150150.258222-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 v2 06/12] nbd/server: get rid of EAGAIN dead code 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" For now nbd_read never returns EAGAIN. So, don't handle it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- nbd/server.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index dd6b241761..b0bb263596 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -997,11 +997,12 @@ static int nbd_co_send_reply(NBDRequestData *req, NBD= Reply *reply, int len) return rc; } =20 -/* Collect a client request. Return 0 if request looks valid, -EAGAIN - * to keep trying the collection, -EIO to drop connection right away, - * and any other negative value to report an error to the client - * (although the caller may still need to disconnect after reporting - * the error). */ +/* nbd_co_receive_request + * Collect a client request. Return 0 if request looks valid, -EIO to drop + * connection right away, and any other negative value to report an error = to + * the client (although the caller may still need to disconnect after repo= rting + * the error). + */ static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request) { NBDClient *client =3D req->client; @@ -1011,9 +1012,7 @@ static int nbd_co_receive_request(NBDRequestData *req= , NBDRequest *request) assert(client->recv_coroutine =3D=3D qemu_coroutine_self()); rc =3D nbd_receive_request(client->ioc, request); if (rc < 0) { - if (rc !=3D -EAGAIN) { - rc =3D -EIO; - } + rc =3D -EIO; goto out; } =20 @@ -1114,9 +1113,6 @@ static coroutine_fn void nbd_trip(void *opaque) =20 req =3D nbd_request_get(client); ret =3D nbd_co_receive_request(req, &request); - if (ret =3D=3D -EAGAIN) { - goto done; - } if (ret =3D=3D -EIO) { goto out; } --=20 2.11.1