summaryrefslogtreecommitdiff
path: root/migration/savevm.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2015-08-13 11:51:33 +0100
committerAmit Shah <amit.shah@redhat.com>2015-09-29 11:33:02 +0530
commita202a4c001fd35b50d99abcc329bc9e666eb8eed (patch)
treedac5691e8ef5a7ddbea5020b5123e11e0d249549 /migration/savevm.c
parentc50766f5a99ef7bf6c9a86cd07341c389faf7ae6 (diff)
migration: size_t'ify some of qemu-file
This is a start on using size_t more in qemu-file and friends; it fixes up QEMUFilePutBufferFunc and QEMUFileGetBufferFunc to take size_t lengths and return ssize_t return values (like read(2)) and fixes up all the different implementations of them. Note that I've not yet followed this deeply into bdrv_ implementations. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <1439463094-5394-5-git-send-email-dgilbert@redhat.com> Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'migration/savevm.c')
-rw-r--r--migration/savevm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index 33e55fea09..96b8210cc3 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -138,14 +138,15 @@ static ssize_t block_writev_buffer(void *opaque, struct iovec *iov, int iovcnt,
return qiov.size;
}
-static int block_put_buffer(void *opaque, const uint8_t *buf,
- int64_t pos, int size)
+static ssize_t block_put_buffer(void *opaque, const uint8_t *buf,
+ int64_t pos, size_t size)
{
bdrv_save_vmstate(opaque, buf, pos, size);
return size;
}
-static int block_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)
+static ssize_t block_get_buffer(void *opaque, uint8_t *buf, int64_t pos,
+ size_t size)
{
return bdrv_load_vmstate(opaque, buf, pos, size);
}