[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 22/22] iotests: Add test for different refcou
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 22/22] iotests: Add test for different refcount widths |
Date: |
Thu, 20 Nov 2014 16:04:48 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 11/20/2014 10:06 AM, Max Reitz wrote:
> Add a test for conversion between different refcount widths and errors
> specific to certain widths (i.e. snapshots with refcount_width=1).
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> tests/qemu-iotests/112 | 278
> +++++++++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/112.out | 143 +++++++++++++++++++++++
> tests/qemu-iotests/group | 1 +
> 3 files changed, 422 insertions(+)
> create mode 100755 tests/qemu-iotests/112
> create mode 100644 tests/qemu-iotests/112.out
>
> +echo
> +echo '=== Multiple walks necessary during amend ==='
> +echo
> +
> +IMGOPTS="$IMGOPTS,refcount_width=1,cluster_size=512" _make_test_img 64k
> +
> +# Cluster 0 is the image header, clusters 1 to 4 are used by the L1 table, a
> +# single L2 table, the reftable and a single refblock. This creates 58 data
> +# clusters (actually, the L2 table is created here, too), so in total there
> are
> +# then 63 used clusters in the image. With a refcount width of 64, one
> refblock
> +# describes 64 clusters (512 bytes / 64 bits/entry = 64 entries), so this
> will
> +# make the first refblock in the amended image have exactly one free entry.
> +$QEMU_IO -c "write 0 $((58 * 512))" "$TEST_IMG" | _filter_qemu_io
> +
> +# Now change the refcount width; since the first new refblock will have
> exactly
> +# one free entry, that entry will be used to store its own reference. No
> other
> +# refblocks are needed, so then the new reftable will be allocated; since the
> +# first new refblock is completely filled up, this will require a new
> refblock
> +# which is why the refcount width changing function will need to run through
> +# everything one more time until the allocations are stable.
> +# Having more walks than usual should be visible as regressing progress (from
> +# 66.67 % (2/3 walks) to 50.00 % (2/4 walks)).
> +$QEMU_IMG amend -o refcount_width=64 -p "$TEST_IMG" | tr '\r' '\n' \
> + | grep -A 1 '66.67'
You probably know the drill by now: 'grep -A' is a GNU extension, and
not necessarily portable to other grep. Portable would be "grep 66.67 |
head -n2", but I'm not going to insist on a rewrite since we already
depend on other GNU-isms in the testsuite. (Or put another way, if
someone runs the test on BSD and it fails, _then_ we can patch things).
> +
> +=== Multiple walks necessary during amend ===
> +
> +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536
> +wrote 29696/29696 bytes at offset 0
> +29 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> + (66.67/100%)
> + (50.00/100%)
> +refcount width: 64
> +No errors were found on the image.
Nicely done, here, and in the overall series.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 13/22] progress: Allow regressing progress, (continued)
- [Qemu-devel] [PATCH v3 13/22] progress: Allow regressing progress, Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 16/22] qcow2: Use abort() instead of assert(false), Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 15/22] qcow2: Use error_report() in qcow2_amend_options(), Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 14/22] block: Add opaque value to the amend CB, Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 17/22] qcow2: Split upgrade/downgrade paths for amend, Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 18/22] qcow2: Use intermediate helper CB for amend, Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 19/22] qcow2: Add function for refcount order amendment, Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 20/22] qcow2: Invoke refcount order amendment function, Max Reitz, 2014/11/20
- [Qemu-devel] [PATCH v3 22/22] iotests: Add test for different refcount widths, Max Reitz, 2014/11/20
- Re: [Qemu-devel] [PATCH v3 22/22] iotests: Add test for different refcount widths,
Eric Blake <=
- [Qemu-devel] [PATCH v3 21/22] qcow2: Point to amend function in check, Max Reitz, 2014/11/20