From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDs8x-0000ac-9Q for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:27:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDs8r-00071R-A3 for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:27:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDs8r-00071L-2s for qemu-devel@nongnu.org; Mon, 26 Aug 2013 04:27:17 -0400 Message-ID: <521B115D.4040009@redhat.com> Date: Mon, 26 Aug 2013 10:27:09 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1377264653-31031-1-git-send-email-lilei@linux.vnet.ibm.com> <1377264653-31031-3-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1377264653-31031-3-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH resend 3/3] arch_init: right return for ram_save_iterate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: mrhines@linux.vnet.ibm.com, qemu-devel@nongnu.org, anthony@codemonkey.ws Il 23/08/2013 15:30, Lei Li ha scritto: > - 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; > + return qemu_file_get_error(f); No, this will never make ram_save_iterate (and thus qemu_savevm_state_iterate) return a positive, non-zero value. Thus: ret = qemu_file_get_error(f); if (ret < 0) { return ret; } return total_sent; If you look at the code, you can see that it never returns zero. Probably it should do something like 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; and then proceed as above with "ret = qemu_file_get_error(f)". Paolo