aboutsummaryrefslogtreecommitdiff
path: root/qemu-file.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-02-26 22:31:10 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-02-26 22:31:10 +0000
commit6f6831f61a44fde832ee6fab0cc5632de34cf6b7 (patch)
tree47e59106156748bef6ef87537ad230ae7bec6044 /qemu-file.c
parentbc3fbad816961a5b4a7f51a37472c4ac01effb92 (diff)
parent41310c68781d742fa9bbfd5fcb1df9b7f23f5759 (diff)
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140225' into staging
migration/next for 20140225 # gpg: Signature made Tue 25 Feb 2014 14:04:31 GMT using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20140225: rdma: rename 'x-rdma' => 'rdma' Fix two XBZRLE corruption issues Fix vmstate_info_int32_le comparison/assign qemu_file: use fwrite() correctly Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qemu-file.c')
-rw-r--r--qemu-file.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/qemu-file.c b/qemu-file.c
index 9473b674ba..f074af15c3 100644
--- a/qemu-file.c
+++ b/qemu-file.c
@@ -100,7 +100,14 @@ static int stdio_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,
int size)
{
QEMUFileStdio *s = opaque;
- return fwrite(buf, 1, size, s->stdio_file);
+ int res;
+
+ res = fwrite(buf, 1, size, s->stdio_file);
+
+ if (res != size) {
+ return -EIO; /* fake errno value */
+ }
+ return res;
}
static int stdio_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)