From: Wangting (Kathy) Date: Tue, 19 Nov 2013 05:53:45 +0000 (+0000) Subject: The calculation of bytes_xfer in qemu_put_buffer() is wrong X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8e86729a0e83b557c22808a2337252c969ca3986;p=qemu.git 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 Signed-off-by: Juan Quintela --- diff --git a/savevm.c b/savevm.c index 2f631d4045..3f912ddcf9 100644 --- a/savevm.c +++ b/savevm.c @@ -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); }