Skip to content

Commit

Permalink
The calculation of bytes_xfer in qemu_put_buffer() is wrong
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Juan Quintela <[email protected]>
  • Loading branch information
Wangting (Kathy) authored and Juan Quintela committed Nov 20, 2013
1 parent 394cfa3 commit 8e86729
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion savevm.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)
if (l > size)
l = size;
memcpy(f->buf + f->buf_index, buf, l);
f->bytes_xfer += size;
f->bytes_xfer += l;
if (f->ops->writev_buffer) {
add_to_iovec(f, f->buf + f->buf_index, l);
}
Expand Down

0 comments on commit 8e86729

Please sign in to comment.