mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
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>
This commit is contained in:
parent
c50766f5a9
commit
a202a4c001
7 changed files with 30 additions and 24 deletions
|
@ -54,7 +54,8 @@ static int socket_get_fd(void *opaque)
|
|||
return s->fd;
|
||||
}
|
||||
|
||||
static int socket_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)
|
||||
static ssize_t socket_get_buffer(void *opaque, uint8_t *buf, int64_t pos,
|
||||
size_t size)
|
||||
{
|
||||
QEMUFileSocket *s = opaque;
|
||||
ssize_t len;
|
||||
|
@ -138,7 +139,8 @@ static ssize_t unix_writev_buffer(void *opaque, struct iovec *iov, int iovcnt,
|
|||
return total;
|
||||
}
|
||||
|
||||
static int unix_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)
|
||||
static ssize_t unix_get_buffer(void *opaque, uint8_t *buf, int64_t pos,
|
||||
size_t size)
|
||||
{
|
||||
QEMUFileSocket *s = opaque;
|
||||
ssize_t len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue