From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v3 08/10] migration: handle the error condition properly Date: Wed, 8 Aug 2018 14:29:52 +0800 Message-ID: <503d7733-e2e7-09c5-75a3-1e250f549065@gmail.com> References: <20180807091209.13531-1-xiaoguangrong@tencent.com> <20180807091209.13531-9-xiaoguangrong@tencent.com> <20180808050846.GG24415@xz-mi> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mst@redhat.com, mtosatti@redhat.com, Xiao Guangrong , dgilbert@redhat.com, qemu-devel@nongnu.org, wei.w.wang@intel.com, jiang.biao2@zte.com.cn, pbonzini@redhat.com To: Peter Xu Return-path: In-Reply-To: <20180808050846.GG24415@xz-mi> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel2=m.gmane.org@nongnu.org Sender: "Qemu-devel" List-Id: kvm.vger.kernel.org On 08/08/2018 01:08 PM, Peter Xu wrote: > On Tue, Aug 07, 2018 at 05:12:07PM +0800, guangrong.xiao@gmail.com wrote: >> From: Xiao Guangrong >> >> ram_find_and_save_block() can return negative if any error hanppens, >> however, it is completely ignored in current code > > Could you hint me where we'll return an error? > I think control_save_page() may return a error condition but i am not good at it ... Other places look safe _currently_. These functions were designed to have error returned anyway. > (Anyway I agree that the error handling is not that good, mostly > because the QEMUFile APIs does not provide proper return code, e.g., > qemu_put_be64 returns void) > Yes, it is, the returned error condition is mixed in file's API and function's return value... :(