From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj6mX-0006gO-E3 for qemu-devel@nongnu.org; Wed, 20 Nov 2013 07:21:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj6mS-0002zo-Go for qemu-devel@nongnu.org; Wed, 20 Nov 2013 07:21:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj6mS-0002ze-8z for qemu-devel@nongnu.org; Wed, 20 Nov 2013 07:21:16 -0500 Message-ID: <528CA959.2020707@redhat.com> Date: Wed, 20 Nov 2013 14:21:45 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1384946787-8190-1-git-send-email-quintela@redhat.com> <1384946787-8190-2-git-send-email-quintela@redhat.com> In-Reply-To: <1384946787-8190-2-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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: Juan Quintela , qemu-devel@nongnu.org Cc: aliguori@amazon.com, zhangmin , "Wangting (Kathy)" On 11/20/2013 01:26 PM, Juan Quintela wrote: > 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); > } > Reviewed-by: Orit Wasserman