]> git.proxmox.com Git - qemu.git/commitdiff
The calculation of bytes_xfer in qemu_put_buffer() is wrong
authorWangting (Kathy) <kathy.wangting@huawei.com>
Tue, 19 Nov 2013 05:53:45 +0000 (05:53 +0000)
committerJuan Quintela <quintela@redhat.com>
Wed, 20 Nov 2013 11:16:04 +0000 (12:16 +0100)
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>
savevm.c

index 2f631d4045cd45ce03b639897dafe459cf3cafd9..3f912ddcf9919ca9060a6fb385d9ee398139f24a 100644 (file)
--- 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);
         }