diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2015-08-13 11:51:33 +0100 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2015-09-29 11:33:02 +0530 |
commit | a202a4c001fd35b50d99abcc329bc9e666eb8eed (patch) | |
tree | dac5691e8ef5a7ddbea5020b5123e11e0d249549 /include/migration | |
parent | c50766f5a99ef7bf6c9a86cd07341c389faf7ae6 (diff) | |
download | qemu-a202a4c001fd35b50d99abcc329bc9e666eb8eed.tar.gz qemu-a202a4c001fd35b50d99abcc329bc9e666eb8eed.tar.bz2 qemu-a202a4c001fd35b50d99abcc329bc9e666eb8eed.zip |
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 'include/migration')
-rw-r--r-- | include/migration/qemu-file.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h index ea49f33fac..e1e2babcf5 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -31,15 +31,15 @@ * The pos argument can be ignored if the file is only being used for * streaming. The handler should try to write all of the data it can. */ -typedef int (QEMUFilePutBufferFunc)(void *opaque, const uint8_t *buf, - int64_t pos, int size); +typedef ssize_t (QEMUFilePutBufferFunc)(void *opaque, const uint8_t *buf, + int64_t pos, size_t size); /* Read a chunk of data from a file at the given position. The pos argument * can be ignored if the file is only be used for streaming. The number of * bytes actually read should be returned. */ -typedef int (QEMUFileGetBufferFunc)(void *opaque, uint8_t *buf, - int64_t pos, int size); +typedef ssize_t (QEMUFileGetBufferFunc)(void *opaque, uint8_t *buf, + int64_t pos, size_t size); /* Close a file * |