The calculation of bytes_xfer in qemu_put_buffer() is wrong
In qemu_put_buffer(), bytes_xfer += size is wrong, it will be more than expected, and should be bytes_xfer += l. Signed-off-by: zhangmin <zhangmin6@huawei.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
394cfa39ba
commit
8e86729a0e
2
savevm.c
2
savevm.c
@ -794,7 +794,7 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)
|
|||||||
if (l > size)
|
if (l > size)
|
||||||
l = size;
|
l = size;
|
||||||
memcpy(f->buf + f->buf_index, buf, l);
|
memcpy(f->buf + f->buf_index, buf, l);
|
||||||
f->bytes_xfer += size;
|
f->bytes_xfer += l;
|
||||||
if (f->ops->writev_buffer) {
|
if (f->ops->writev_buffer) {
|
||||||
add_to_iovec(f, f->buf + f->buf_index, l);
|
add_to_iovec(f, f->buf + f->buf_index, l);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user