From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS1YX-0006Zd-GT for qemu-devel@nongnu.org; Mon, 24 Mar 2014 05:52:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS1YR-0004IQ-HE for qemu-devel@nongnu.org; Mon, 24 Mar 2014 05:52:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS1YR-0004ID-9t for qemu-devel@nongnu.org; Mon, 24 Mar 2014 05:52:27 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2O9qQk0021535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Mar 2014 05:52:26 -0400 Date: Mon, 24 Mar 2014 09:52:22 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20140324095221.GB3829@work-vm> References: <1395430254-14291-1-git-send-email-dgilbert@redhat.com> <532CA4C7.8060204@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <532CA4C7.8060204@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 1/1] Make qemu_peek_buffer loop until it gets it's data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, quintela@redhat.com * Eric Blake (eblake@redhat.com) wrote: > On 03/21/2014 01:30 PM, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > 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. If I need to recut it for another reason I'll change it. However, it's a perfectly common abbreviation that's widely used (hundreds of times in the kernel source for example). Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK