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

2012-02-06 Thread Stefan Hajnoczi
On Tue, Jan 24, 2012 at 3:03 PM, Kevin Wolf kw...@redhat.com wrote: Am 18.01.2012 15:59, schrieb Stefan Hajnoczi: @@ -303,6 +303,40 @@ void qemu_iovec_memset_skip(QEMUIOVector *qiov, int c, size_t count,      }  } +/* + * Checks if a buffer is all zeroes + * + * Attention! The len must

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

2012-01-24 Thread Kevin Wolf
Am 18.01.2012 15:59, schrieb 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

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

2012-01-18 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