From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VigX7-0002Pg-Ah for qemu-devel@nongnu.org; Tue, 19 Nov 2013 03:19:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VigX2-0005GG-FQ for qemu-devel@nongnu.org; Tue, 19 Nov 2013 03:19:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VigX2-0005G4-7H for qemu-devel@nongnu.org; Tue, 19 Nov 2013 03:19:36 -0500 Message-ID: <528B1F0B.40001@redhat.com> Date: Tue, 19 Nov 2013 09:19:23 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 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: "Wangting (Kathy)" Cc: "zhangmin (S)" , Luonengjun , "qemu-devel@nongnu.org" , Qinling , "Chentao (Boby)" , "Wangrui (K)" , "Wubin (H)" Il 19/11/2013 06:53, Wangting (Kathy) ha scritto: > 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 > --- > savevm.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > 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.7.3.1.msysgit.0 Reviewed-by: Paolo Bonzini