[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] savevm: define qemu_get_byte() using qemu_p
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] savevm: define qemu_get_byte() using qemu_peek_byte() |
Date: |
Fri, 07 Oct 2011 00:40:49 +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:
>> + result = qemu_peek_byte(f);
>> +
>> + if (f->buf_index< f->buf_size) {
>> + f->buf_index++;
>> }
>
> This should really be an assert that f->buf_index < f->buf_size,
> otherwise qemu_peek_byte has read garbage.
That is a change from current behaviour. qemu_get_byte() returns 0 in
the case that there is nothing to read. Yes, it is ugly.
Later, Juan.