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>
if (l > size)
l = size;
memcpy(f->buf + f->buf_index, buf, l);
if (l > size)
l = size;
memcpy(f->buf + f->buf_index, buf, l);
if (f->ops->writev_buffer) {
add_to_iovec(f, f->buf + f->buf_index, l);
}
if (f->ops->writev_buffer) {
add_to_iovec(f, f->buf + f->buf_index, l);
}