From: Liu Yuan <namei.unix@gmail.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Subject: [Qemu-devel] RE. [PATCH] sheepdog: fix send req helpers
Date: Tue, 3 Apr 2012 18:04:21 +0800 [thread overview]
Message-ID: <1333447461-317-1-git-send-email-namei.unix@gmail.com> (raw)
In-Reply-To: <4F7ABF13.4060305@redhat.com>
From: Liu Yuan <tailai.ly@taobao.com>
Yes, I think so. Here is the patch.
Subject: [PATCH] sheepdog: fix send req helpers
From: Liu Yuan <tailai.ly@taobao.com>
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>
---
block/sheepdog.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 62dfa48..73308b2 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);
--
1.7.8.2
next prev parent reply other threads:[~2012-04-03 10:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-02 17:35 [Qemu-devel] [PATCH] sheepdog: implement SD_OP_FLUSH_VDI operation Liu Yuan
2012-04-02 20:01 ` Michael Tokarev
2012-04-03 5:14 ` Liu Yuan
2012-04-03 5:15 ` [Qemu-devel] [PATCH v2] " Liu Yuan
2012-04-03 7:23 ` Stefan Hajnoczi
2012-04-03 8:35 ` [Qemu-devel] [PATCH v3] " Liu Yuan
2012-04-03 9:12 ` Kevin Wolf
2012-04-03 10:04 ` Liu Yuan [this message]
2012-04-03 11:13 ` [Qemu-devel] RE. [PATCH] sheepdog: fix send req helpers MORITA Kazutaka
2012-04-03 11:34 ` Kevin Wolf
2012-04-03 9:52 ` [Qemu-devel] [PATCH v3] sheepdog: implement SD_OP_FLUSH_VDI operation MORITA Kazutaka
2012-04-03 9:58 ` [Qemu-devel] [PATCH v4] " Liu Yuan
2012-04-03 10:08 ` [Qemu-devel] [PATCH v4 UPDATE] " Liu Yuan
2012-04-03 10:32 ` MORITA Kazutaka
2012-04-03 10:30 ` Kevin Wolf
2012-04-03 20:03 ` [Qemu-devel] [PATCH v5] " Liu Yuan
2012-04-04 8:53 ` Kevin Wolf
2012-04-04 8:58 ` Liu Yuan
2012-04-04 9:20 ` Kevin Wolf
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=1333447461-317-1-git-send-email-namei.unix@gmail.com \
--to=namei.unix@gmail.com \
--cc=kwolf@redhat.com \
--cc=morita.kazutaka@lab.ntt.co.jp \
--cc=qemu-devel@nongnu.org \
/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).