qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Subject: [Qemu-devel] [PULL 29/41] nbd/server: get rid of EAGAIN dead code
Date: Thu, 15 Jun 2017 12:52:49 +0200	[thread overview]
Message-ID: <1497523981-38449-30-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1497523981-38449-1-git-send-email-pbonzini@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

For now nbd_read never returns EAGAIN. So, don't handle it.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170602150150.258222-7-vsementsov@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 nbd/server.c | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index 8ceac89..00a19f6 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -997,11 +997,12 @@ static int nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, int len)
     return rc;
 }
 
-/* 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 reporting
+ * the error).
+ */
 static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request)
 {
     NBDClient *client = req->client;
@@ -1011,9 +1012,7 @@ static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request)
     assert(client->recv_coroutine == qemu_coroutine_self());
     rc = nbd_receive_request(client->ioc, request);
     if (rc < 0) {
-        if (rc != -EAGAIN) {
-            rc = -EIO;
-        }
+        rc = -EIO;
         goto out;
     }
 
@@ -1114,9 +1113,6 @@ static coroutine_fn void nbd_trip(void *opaque)
 
     req = nbd_request_get(client);
     ret = nbd_co_receive_request(req, &request);
-    if (ret == -EAGAIN) {
-        goto done;
-    }
     if (ret == -EIO) {
         goto out;
     }
-- 
1.8.3.1

  parent reply	other threads:[~2017-06-15 10:53 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 10:52 [Qemu-devel] [PULL 00/41] Misc patches for 2017-06-15 Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 01/41] exec: check kvm mmu notifiers earlier Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 02/41] exec: split file_ram_alloc() Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 03/41] exec: split qemu_ram_alloc_from_file() Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 04/41] Add memory_region_init_ram_from_fd() Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 05/41] ivshmem: use ram_from_fd() Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 06/41] memory: remove memory_region_set_fd Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 07/41] megasas: add qtest Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 08/41] megasas: do not read sense length more than once from frame Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 09/41] megasas: do not read iovec count " Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 10/41] megasas: do not read DCMD opcode " Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 11/41] megasas: do not read command " Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 12/41] megasas: do not read SCSI req parameters " Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 13/41] megasas: always store SCSIRequest* into MegasasCmd Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 14/41] Makefile: Do not generate files if "configure" has not been run yet Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 15/41] vl: Fix broken thread=xxx option of the --accel parameter Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 16/41] kvm-all: make async_safe_run_on_cpu safe on kvm too Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 17/41] hax-all: make async_safe_run_on_cpu safe on HAX too Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 18/41] nbd: Fix regression on resiliency to port scan Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 19/41] qemu-nbd: Ignore SIGPIPE Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 20/41] accel: split the tcg accelerator from accel.c file Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 21/41] tcg: move tcg related files into accel/tcg/ subdirectory Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 22/41] tcg: move tcg backend files into accel/tcg/ Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 23/41] accel: move kvm related accelerator files into accel/ Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 24/41] nbd: rename read_sync and friends Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 25/41] nbd: make nbd_drop public Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 26/41] nbd/server: get rid of nbd_negotiate_read and friends Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 27/41] nbd/server: get rid of ssize_t Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 28/41] nbd/server: refactor nbd_co_send_reply Paolo Bonzini
2017-06-15 10:52 ` Paolo Bonzini [this message]
2017-06-15 10:52 ` [Qemu-devel] [PULL 30/41] nbd/server: refactor nbd_co_receive_request Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 31/41] nbd/server: remove NBDClientNewData Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 32/41] nbd/server: nbd_negotiate: fix error path Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 33/41] nbd/server: get rid of fail: return rc Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 34/41] nbd/server: rename rc to ret Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 35/41] nbd/server: refactor nbd_trip Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 36/41] include/exec/poison: Add missing TARGET defines Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 37/41] include/exec/poison: Mark some CONFIG defines as poisoned, too Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 38/41] docs: create interop/ subdirectory Paolo Bonzini
2017-06-15 10:52 ` [Qemu-devel] [PULL 39/41] qemu-doc: include version number Paolo Bonzini
2017-06-15 10:53 ` [Qemu-devel] [PULL 40/41] vhost-user-scsi: Introduce vhost-user-scsi host device Paolo Bonzini
2017-07-18 16:32   ` Marc-André Lureau
2017-07-23 14:47     ` Paolo Bonzini
2017-06-15 10:53 ` [Qemu-devel] [PULL 41/41] vhost-user-scsi: Introduce a vhost-user-scsi sample application Paolo Bonzini
2017-06-20 15:00 ` [Qemu-devel] [PULL 00/41] Misc patches for 2017-06-15 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497523981-38449-30-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).