[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/5] savevm: improve subsections detection on lo
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH 4/5] savevm: improve subsections detection on load |
Date: |
Fri, 07 Oct 2011 00:42:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Paolo Bonzini <address@hidden> 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.