]> git.proxmox.com Git - qemu.git/commit
cutils: extract buffer_is_zero() from qemu-img.c
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Tue, 7 Feb 2012 13:27:24 +0000 (13:27 +0000)
committerKevin Wolf <kwolf@redhat.com>
Thu, 9 Feb 2012 15:17:50 +0000 (16:17 +0100)
commit1a6d39fd71ddf90c5b76026cac4d5ff51fbaf8d8
tree9b15c86f85e8141f3a20cbf9f52ea21a0719e598
parent7a65c8cc315c76bde6d692845c12e7ba06f44f89
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 <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
cutils.c
qemu-common.h
qemu-img.c