From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBweG-0000Zi-CN for qemu-devel@nongnu.org; Thu, 06 Oct 2011 18:42:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBweE-0002Dy-Ky for qemu-devel@nongnu.org; Thu, 06 Oct 2011 18:42:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBweE-0002Dp-Do for qemu-devel@nongnu.org; Thu, 06 Oct 2011 18:42:38 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p96MgbYJ019409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Oct 2011 18:42:37 -0400 From: Juan Quintela In-Reply-To: <4E8DD6D1.7020708@redhat.com> (Paolo Bonzini's message of "Thu, 06 Oct 2011 18:26:57 +0200") References: <4E8DD6D1.7020708@redhat.com> Date: Fri, 07 Oct 2011 00:42:36 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 4/5] savevm: improve subsections detection on load Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Paolo Bonzini wrote: > On 10/06/2011 06:21 PM, Juan Quintela wrote: >> + >> +int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size) >> +{ >> + int pending = size; >> + int done = 0; >> + >> + while (pending> 0) { >> + int res; >> + >> + res = qemu_peek_buffer(f, buf, pending, 0); >> + if (res == 0) { >> + return 0; should this line return "done" insntead? >> } >> - memcpy(buf, f->buf + f->buf_index, l); >> - f->buf_index += l; >> - buf += l; >> - size -= l; >> + qemu_file_skip(f, res); >> + buf += res; >> + pending -= res; >> + done += res; >> } >> - return size1 - size; >> + return done; >> } > > This changes semantics for reads above 32KB. It should be in the > commit message, or preferably v1 could be committed instead. :) how it changes? My understanding is that we read the same, only change that I can think of is the one that I have jsut shown (and that is on the error case). Later, Juan.