From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBqmr-0003AL-DV for qemu-devel@nongnu.org; Thu, 06 Oct 2011 12:27:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBqmp-0006Wa-Dx for qemu-devel@nongnu.org; Thu, 06 Oct 2011 12:27:09 -0400 Received: from mail-bw0-f45.google.com ([209.85.214.45]:39752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBqmp-0006WT-8z for qemu-devel@nongnu.org; Thu, 06 Oct 2011 12:27:07 -0400 Received: by bkbzv15 with SMTP id zv15so3660586bkb.4 for ; Thu, 06 Oct 2011 09:27:06 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E8DD6D1.7020708@redhat.com> Date: Thu, 06 Oct 2011 18:26:57 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/5] savevm: improve subsections detection on load List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org 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; > } > - 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. :) Paolo