« Previous | Next » 

Revision 1a6d39fd

ID1a6d39fd71ddf90c5b76026cac4d5ff51fbaf8d8

Added by Stefan Hajnoczi about 12 years ago

cutils: extract buffer_is_zero() from qemu-img.c

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. !is_not_zero()) that the old
function can cause in callers.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences