iotests: Add test 179 to cover write zeroes with unmap
commite249d5195279cfadb7f15e2ad55dd4fe1d67c105
authorEric Blake <eblake@redhat.com>
Sun, 7 May 2017 00:05:49 +0000 (6 19:05 -0500)
committerMax Reitz <mreitz@redhat.com>
Thu, 11 May 2017 12:28:07 +0000 (11 14:28 +0200)
tree53c85c4676418ad50873a7f9b6c40c0248e8b2dc
parentd9ca2214bd058cfb4371b8373123c0444e4a5ac8
iotests: Add test 179 to cover write zeroes with unmap

No tests were covering write zeroes with unmap.  Additionally,
I needed to prove that my previous patches for correct status
reporting and write zeroes optimizations actually had an impact.

The test works for cluster_size between 8k and 2M (for smaller
sizes, it fails because our allocation patterns are not contiguous
with small clusters - in part, the largest consecutive allocation
we tend to get is often bounded by the size covered by one L2
table).

Note that testing for zero clusters is tricky: 'qemu-io map'
reports whether data comes from the current layer of the image
(useful for sniffing out which regions of the file have
QCOW_OFLAG_ZERO) - but doesn't show which clusters have mappings;
while 'qemu-img map' sees "zero":true for both unallocated and
zero clusters for any qcow2 with no backing layer (so less useful
at detecting true zero clusters), but reliably shows mappings.
So we have to rely on both queries side-by-side at each point of
the test.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170507000552.20847-10-eblake@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
tests/qemu-iotests/179 [new file with mode: 0755]
tests/qemu-iotests/179.out [new file with mode: 0644]
tests/qemu-iotests/group