aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorLiu Yuan <tailai.ly@taobao.com>2012-04-03 18:04:21 +0800
committerKevin Wolf <kwolf@redhat.com>2012-04-05 14:54:41 +0200
commiteb09218077a495bc55d84de91f448f72fe78a60b (patch)
tree2f944e98188d66ebb1fa7fbb0350307828eac4f9 /block
parent47622c44d0d9a717c1a8f7f5fec6c25ff3b30eec (diff)
sheepdog: fix send req helpers
We should return if reading of the header fails. Cc: Kevin Wolf <kwolf@redhat.com> Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Acked-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/sheepdog.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 1248534984..3eaf625e98 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -510,6 +510,7 @@ static int send_req(int sockfd, SheepdogReq *hdr, void *data,
ret = qemu_send_full(sockfd, hdr, sizeof(*hdr), 0);
if (ret < sizeof(*hdr)) {
error_report("failed to send a req, %s", strerror(errno));
+ return ret;
}
ret = qemu_send_full(sockfd, data, *wlen, 0);
@@ -528,6 +529,7 @@ static int send_co_req(int sockfd, SheepdogReq *hdr, void *data,
ret = qemu_co_send(sockfd, hdr, sizeof(*hdr));
if (ret < sizeof(*hdr)) {
error_report("failed to send a req, %s", strerror(errno));
+ return ret;
}
ret = qemu_co_send(sockfd, data, *wlen);