On 04.05.2017 05:07, Eric Blake wrote: > 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 <ebl...@redhat.com> > > --- > v12: probe the map in more places, to make test easier to follow > v11: reserved for blkdebug half of v10 > v10: drop any changes to v2 files, rewrite test to work with updates > earlier in the series, add a blkdebug probe > v9: new patch > --- > tests/qemu-iotests/179 | 132 +++++++++++++++++++++++++++++++++++++ > tests/qemu-iotests/179.out | 160 > +++++++++++++++++++++++++++++++++++++++++++++ > tests/qemu-iotests/group | 1 + > 3 files changed, 293 insertions(+) > create mode 100755 tests/qemu-iotests/179 > create mode 100644 tests/qemu-iotests/179.out
Reviewed-by: Max Reitz <mre...@redhat.com> TIL qemu-io -c w.
signature.asc
Description: OpenPGP digital signature