Re: [Qemu-devel] [PATCH 04/19] nbd/server: get rid of EAGAIN dead code

2017-05-30 Thread Eric Blake
On 05/30/2017 09:30 AM, Vladimir Sementsov-Ogievskiy wrote:
> For now read_sync never returns EAGAIN. So, don't handle it.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy 
> ---
>  nbd/server.c | 18 +++---
>  1 file changed, 7 insertions(+), 11 deletions(-)
> 

I had to go re-read your cover letter, to learn that EAGAIN went away in
your prerequisite series (I see Paolo has a pending PULL request with
your prerequisite in place, but it's not yet on master).

Reviewed-by: Eric Blake 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] [PATCH 04/19] nbd/server: get rid of EAGAIN dead code

2017-05-30 Thread Vladimir Sementsov-Ogievskiy
For now read_sync never returns EAGAIN. So, don't handle it.

Signed-off-by: Vladimir Sementsov-Ogievskiy 
---
 nbd/server.c | 18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/nbd/server.c b/nbd/server.c
index e18eb020a7..fcf35f0270 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;
 }
-- 
2.11.1