aboutsummaryrefslogtreecommitdiff
path: root/nbd/client.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2017-08-04 18:14:25 +0300
committerEric Blake <eblake@redhat.com>2017-08-30 13:00:38 -0500
commitab01df1fe21c013d1fd9e3f4c782430741c7dd33 (patch)
treeb65500fefd4e3f01cee811b6beaf87da40930b71 /nbd/client.c
parenta0acf3a8f716946d7c425870bd05bc6dfe7667a2 (diff)
nbd/client: refactor nbd_read_eof
Refactor nbd_read_eof to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20170804151440.320927-3-vsementsov@virtuozzo.com> [eblake: tweak function comments, rebase to test 083 enhancements] Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'nbd/client.c')
-rw-r--r--nbd/client.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/nbd/client.c b/nbd/client.c
index f1c16b588f..4556056daa 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -925,11 +925,6 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)
return ret;
}
- if (ret != sizeof(buf)) {
- error_setg(errp, "read failed");
- return -EINVAL;
- }
-
/* Reply
[ 0 .. 3] magic (NBD_REPLY_MAGIC)
[ 4 .. 7] error (0 == no error)