mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
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>
This commit is contained in:
parent
47622c44d0
commit
eb09218077
1 changed files with 2 additions and 0 deletions
|
@ -510,6 +510,7 @@ static int send_req(int sockfd, SheepdogReq *hdr, void *data,
|
||||||
ret = qemu_send_full(sockfd, hdr, sizeof(*hdr), 0);
|
ret = qemu_send_full(sockfd, hdr, sizeof(*hdr), 0);
|
||||||
if (ret < sizeof(*hdr)) {
|
if (ret < sizeof(*hdr)) {
|
||||||
error_report("failed to send a req, %s", strerror(errno));
|
error_report("failed to send a req, %s", strerror(errno));
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = qemu_send_full(sockfd, data, *wlen, 0);
|
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));
|
ret = qemu_co_send(sockfd, hdr, sizeof(*hdr));
|
||||||
if (ret < sizeof(*hdr)) {
|
if (ret < sizeof(*hdr)) {
|
||||||
error_report("failed to send a req, %s", strerror(errno));
|
error_report("failed to send a req, %s", strerror(errno));
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = qemu_co_send(sockfd, data, *wlen);
|
ret = qemu_co_send(sockfd, data, *wlen);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue