提交 2a6e128b 编写于 作者: V Vladimir Sementsov-Ogievskiy 提交者: Paolo Bonzini

nbd/server: get rid of EAGAIN dead code

For now nbd_read never returns EAGAIN. So, don't handle it.
Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-Id: <20170602150150.258222-7-vsementsov@virtuozzo.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 572b97e7
...@@ -997,11 +997,12 @@ static int nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, int len) ...@@ -997,11 +997,12 @@ static int nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, int len)
return rc; return rc;
} }
/* Collect a client request. Return 0 if request looks valid, -EAGAIN /* nbd_co_receive_request
* to keep trying the collection, -EIO to drop connection right away, * Collect a client request. Return 0 if request looks valid, -EIO to drop
* and any other negative value to report an error to the client * connection right away, and any other negative value to report an error to
* (although the caller may still need to disconnect after reporting * the client (although the caller may still need to disconnect after reporting
* the error). */ * the error).
*/
static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request) static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request)
{ {
NBDClient *client = req->client; NBDClient *client = req->client;
...@@ -1011,9 +1012,7 @@ static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request) ...@@ -1011,9 +1012,7 @@ static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request)
assert(client->recv_coroutine == qemu_coroutine_self()); assert(client->recv_coroutine == qemu_coroutine_self());
rc = nbd_receive_request(client->ioc, request); rc = nbd_receive_request(client->ioc, request);
if (rc < 0) { if (rc < 0) {
if (rc != -EAGAIN) {
rc = -EIO; rc = -EIO;
}
goto out; goto out;
} }
...@@ -1114,9 +1113,6 @@ static coroutine_fn void nbd_trip(void *opaque) ...@@ -1114,9 +1113,6 @@ static coroutine_fn void nbd_trip(void *opaque)
req = nbd_request_get(client); req = nbd_request_get(client);
ret = nbd_co_receive_request(req, &request); ret = nbd_co_receive_request(req, &request);
if (ret == -EAGAIN) {
goto done;
}
if (ret == -EIO) { if (ret == -EIO) {
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册