[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/1] Make qemu_peek_buffer loop until it gets
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/1] Make qemu_peek_buffer loop until it gets it's data |
Date: |
Fri, 21 Mar 2014 14:44:55 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 03/21/2014 01:30 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
>
> Make qemu_peek_buffer repatedly call fill_buffer until it gets
> all the data it requires, or until there is an error.
>
> At the moment, qemu_peek_buffer will try one qemu_fill_buffer if there
> isn't enough data waiting, however the kernel is entitled to return
> just a few bytes, and still leave qemu_peek_buffer with less bytes
> than it needed. I've seen this fail in a dev world, and I think it
> could theoretically fail in the peeking of the subsection headers in
> the current world.
>
> Comment qemu_peek_byte to point out it's not guaranteed to work for
> +/*
> + * Attempt to fill the buffer from the underlying file
> + * Returns the number of bytes read, or -ve value for an error.
s/-ve/negative/ - it is not an obvious abbreviation, and I only knew
what it meant because you have been told to fix it in other patches.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature