From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
Eric Blake <eblake@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/4] iotests: Extend test 066
Date: Thu, 4 May 2017 17:21:21 +0200 [thread overview]
Message-ID: <20170504152121.GC5238@noname.redhat.com> (raw)
In-Reply-To: <20170503231120.23507-5-mreitz@redhat.com>
Am 04.05.2017 um 01:11 hat Max Reitz geschrieben:
> 066 was supposed to be a test "for discarding preallocated zero
> clusters", but it did so incompletely: While it did check the image
> file's integrity after the operation, it did not confirm that the
> clusters are indeed freed. This patch adds this test.
>
> In addition, new cases for writing to preallocated zero clusters are
> added.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> +echo
> +echo '=== Writing to a snapshotted preallocated zero cluster ==='
> +echo
> +
> +_make_test_img 64k
> +
> +# Create a preallocated zero cluster
> +$QEMU_IO -c 'write -P 42 0 64k' -c 'write -z 0 64k' "$TEST_IMG" \
> + | _filter_qemu_io
> +
> +# Snapshot it
> +$QEMU_IMG snapshot -c foo "$TEST_IMG"
> +
> +# Write to the cluster
> +$QEMU_IO -c 'write -P 23 0 64k' "$TEST_IMG" | _filter_qemu_io
> +
> +# Check metadata correctness
> +_check_test_img
> +
> +# Check data correctness
> +$QEMU_IO -c 'read -P 23 0 64k' "$TEST_IMG" | _filter_qemu_io
> +$QEMU_IMG snapshot -a foo "$TEST_IMG"
> +$QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io
This doesn't actually test that we allocated a new cluster, just that
the zero flag from the snapshot L2 table still takes effect. If we
wanted to test this, we could either add some more snapshotting and
writes in order to cause a second COW of the zero cluster, or at least
do a 'qemu-img map'.
Of course, all of this is perfectly fine as a follow-up.
Kevin
next prev parent reply other threads:[~2017-05-04 15:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-03 23:11 [Qemu-devel] [PATCH 0/4] qcow2: Some fixes Max Reitz
2017-05-03 23:11 ` [Qemu-devel] [PATCH 1/4] qcow2: Fix preallocation size formula Max Reitz
2017-05-04 0:54 ` Eric Blake
2017-05-03 23:11 ` [Qemu-devel] [PATCH 2/4] qcow2: Reuse preallocated zero clusters Max Reitz
2017-05-04 0:58 ` Eric Blake
2017-05-03 23:11 ` [Qemu-devel] [PATCH 3/4] qcow2: Discard " Max Reitz
2017-05-04 0:58 ` Eric Blake
2017-05-03 23:11 ` [Qemu-devel] [PATCH 4/4] iotests: Extend test 066 Max Reitz
2017-05-04 1:05 ` Eric Blake
2017-05-04 15:21 ` Kevin Wolf [this message]
2017-05-04 15:23 ` [Qemu-devel] [PATCH 0/4] qcow2: Some fixes Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170504152121.GC5238@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).