Received: from eggs.gnu.org ([208.118.235.92]:57064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sca7G-0003ca-SX for qemu-devel@nongnu.org; Thu, 07 Jun 2012 06:39:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sca7F-0001Qf-3Z for qemu-devel@nongnu.org; Thu, 07 Jun 2012 06:38:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sca7E-0001QR-SS for qemu-devel@nongnu.org; Thu, 07 Jun 2012 06:38:57 -0400 From: Juan Quintela In-Reply-To: <4FCEBCB0.5040402@redhat.com> (Orit Wasserman's message of "Wed, 06 Jun 2012 05:13:04 +0300") References: <1337691425-6022-1-git-send-email-owasserm@redhat.com> <1337691425-6022-8-git-send-email-owasserm@redhat.com> <877gvr8di8.fsf@elfo.elfo> <4FCEBCB0.5040402@redhat.com> Date: Thu, 07 Jun 2012 12:38:39 +0200 Message-ID: <87lijzjtjk.fsf@elfo.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v11 7/9] Add XBZRLE to ram_save_block and ram_save_live Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, Benoit Hudzia , mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, Petter Svard , chegu_vinod@hp.com, avi@redhat.com, Aidan Shribman , pbonzini@redhat.com, eblake@redhat.com Orit Wasserman wrote: > On 06/01/2012 02:42 PM, Juan Quintela wrote: >> We are still not using this value, and we are sending it anyway (with a >> value of zero). What happens when we start using if for a checksum, and >> we migration to a new version that "expects" it to be valid? I would >> preffer not to sent it, or sent the correct value. > I think I will remove it, checksum should be used for all migration > not just XBZRLE. > I guess we can add it to the protocol in the future. Agreed. >> On the other hand ... Why are we doing the stage == 1 test? stage 1 >> normally only sent part of the pages, so we could use the generic code >> there? It would just return -1 as bytes_sent, and do the same code that >> we have now? > > we need to add the pages to the cache in stage 1 (for the next stage), > and there is no need for checking if the page is cached. > and send the pages from the cache for consistency My question is: If we remove the check and just call the other function, everything works, no? So , why add the special case? If it dont' work, we need to change it, because nothing warantees that we fill the cache during stage . >>> void *host; >>> >>> host = host_from_stream_offset(f, addr, flags); >>> + if (!host) { >>> + return -EINVAL; >>> + } >> >> Why is this check only needed now? > I wish I knew, looks like it is missing in upstream. > Do you think I should fix it separately ? Yeap. Thanks, Juan.