From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEyDp-0005Fv-IN for qemu-devel@nongnu.org; Thu, 29 Aug 2013 05:09:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEyDg-0002Im-Cw for qemu-devel@nongnu.org; Thu, 29 Aug 2013 05:08:57 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:49663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEyDf-0002IF-Kz for qemu-devel@nongnu.org; Thu, 29 Aug 2013 05:08:48 -0400 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Aug 2013 14:32:02 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 091521258051 for ; Thu, 29 Aug 2013 14:38:30 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7T9AGk835848318 for ; Thu, 29 Aug 2013 14:40:16 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7T98Z8E012307 for ; Thu, 29 Aug 2013 14:38:35 +0530 Message-ID: <521F0F45.8050404@linux.vnet.ibm.com> Date: Thu, 29 Aug 2013 17:07:17 +0800 From: Lei Li MIME-Version: 1.0 References: <1377509368-24921-1-git-send-email-lilei@linux.vnet.ibm.com> <1377509368-24921-3-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1377509368-24921-3-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3 v2] arch_init: right return for ram_save_iterate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.comx, qemu-devel Cc: mrhines@linux.vnet.ibm.com, anthony@codemonkey.ws, Lei Li Hi, I have tested this series of changes, PING? On 08/26/2013 05:29 PM, Lei Li wrote: > Signed-off-by: Lei Li > Signed-off-by: Paolo Bonzini > --- > > Change since v1: > Return fixes and improvement from Paolo Bonzini. > > arch_init.c | 15 ++++++++++----- > 1 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/arch_init.c b/arch_init.c > index 94d45e1..a26bc89 100644 > --- a/arch_init.c > +++ b/arch_init.c > @@ -709,15 +709,20 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) > */ > ram_control_after_iterate(f, RAM_CONTROL_ROUND); > > + bytes_transferred += total_sent; > + > + /* > + * Do not count these 8 bytes into total_sent, so that we can > + * return 0 if no page had been dirtied. > + */ > + qemu_put_be64(f, RAM_SAVE_FLAG_EOS); > + bytes_transferred += 8; > + > + ret = qemu_file_get_error(f); > if (ret < 0) { > - bytes_transferred += total_sent; > return ret; > } > > - qemu_put_be64(f, RAM_SAVE_FLAG_EOS); > - total_sent += 8; > - bytes_transferred += total_sent; > - > return total_sent; > } > -- Lei