aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-10-11 22:47:11 -0500
committerKevin Wolf <kwolf@redhat.com>2017-10-26 14:45:57 +0200
commitdebb38a4cec34709604a00e23368e6cd8932fe3d (patch)
treea26f707afc46ff0a8c41eb30c54d61de0c46cf5f /tests/qemu-iotests
parent391cb1aacad155bea4270b863710bba9adabe311 (diff)
downloadqemu-debb38a4cec34709604a00e23368e6cd8932fe3d.zip
qemu-debb38a4cec34709604a00e23368e6cd8932fe3d.tar.gz
qemu-debb38a4cec34709604a00e23368e6cd8932fe3d.tar.bz2
qemu-img: Add find_nonzero()
During 'qemu-img compare', when we are checking that an allocated portion of one file is all zeros, we don't need to waste time computing how many additional sectors after the first non-zero byte are also non-zero. Create a new helper find_nonzero() to do the check for a first non-zero sector, and rebase check_empty_sectors() to use it. The new interface intentionally uses bytes in its interface, even though it still crawls the buffer a sector at a time; it is robust to a partial sector at the end of the buffer. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
0 files changed, 0 insertions, 0 deletions