From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj5ve-0002qy-L5 for qemu-devel@nongnu.org; Wed, 20 Nov 2013 06:26:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj5vZ-0004Pv-SK for qemu-devel@nongnu.org; Wed, 20 Nov 2013 06:26:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj5vZ-0004P8-KY for qemu-devel@nongnu.org; Wed, 20 Nov 2013 06:26:37 -0500 From: Juan Quintela Date: Wed, 20 Nov 2013 12:26:27 +0100 Message-Id: <1384946787-8190-2-git-send-email-quintela@redhat.com> In-Reply-To: <1384946787-8190-1-git-send-email-quintela@redhat.com> References: <1384946787-8190-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PATCH] The calculation of bytes_xfer in qemu_put_buffer() is wrong List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: zhangmin , aliguori@amazon.com, "Wangting (Kathy)" From: "Wangting (Kathy)" 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 --- savevm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/savevm.c b/savevm.c index 2f631d4..3f912dd 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); } -- 1.8.3.1