Re: [Qemu-devel] [PATCH v3 1/6] cutils: extract buffer_is_zero() from qemu-img.c

2011-12-22 Thread Stefan Hajnoczi
On Wed, Dec 21, 2011 at 09:43:55AM -0700, Eric Blake wrote: > On 12/21/2011 09:00 AM, Stefan Hajnoczi wrote: > > The qemu-img.c:is_not_zero() function checks if a buffer contains all > > zeroes. This function will come in handy for zero-detection in the > > block layer, so clean it up and move it

Re: [Qemu-devel] [PATCH v3 1/6] cutils: extract buffer_is_zero() from qemu-img.c

2011-12-21 Thread Eric Blake
On 12/21/2011 09:00 AM, Stefan Hajnoczi wrote: > The qemu-img.c:is_not_zero() function checks if a buffer contains all > zeroes. This function will come in handy for zero-detection in the > block layer, so clean it up and move it to cutils.c. > > Note that the function now returns true if the buf

[Qemu-devel] [PATCH v3 1/6] cutils: extract buffer_is_zero() from qemu-img.c

2011-12-21 Thread Stefan Hajnoczi
The qemu-img.c:is_not_zero() function checks if a buffer contains all zeroes. This function will come in handy for zero-detection in the block layer, so clean it up and move it to cutils.c. Note that the function now returns true if the buffer is all zeroes. This avoids the double-negatives (i.e.