From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: famz@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com,
Jeff Cody <jcody@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 7/6] qemu-iotests: Test change-backing-file command
Date: Fri, 15 Sep 2017 14:14:26 -0500 [thread overview]
Message-ID: <97519d8d-e00e-97f6-aa13-98ba06faca88@redhat.com> (raw)
In-Reply-To: <20170915170204.14023-1-kwolf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2468 bytes --]
On 09/15/2017 12:02 PM, Kevin Wolf wrote:
> This involves a temporary read-write reopen if the backing file link in
> the middle of a backing file chain should be changed and is therefore a
> good test for the latest bdrv_reopen() vs. op blockers fixes.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>
> I actually managed to find a simple case that reproduces the bug that
> is fixed in this series, but outside of my commit job improvements that
> originally led me to this work.
>
> tests/qemu-iotests/195 | 92 ++++++++++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/195.out | 78 +++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/group | 1 +
The usual collision in test numbering ;)
> +_cleanup()
> +{
> + _cleanup_test_img
> + rm -f "$TEST_IMG.mid"
> +}
> +trap "_cleanup; exit \$status" 0 1 2 3 15
Semantic conflict with Jeff's work to add './check -s' to save
intermediate files in a per-test temp directory.
> +
> +echo
> +echo "Change backing file of mid (opened read-only)"
> +echo
> +
> +run_qemu -drive if=none,file="$TEST_IMG",backing.node-name=mid <<EOF
> +{"execute":"qmp_capabilities"}
> +{"execute":"change-backing-file", "arguments":{"device":"none0","image-node-name":"mid","backing-file":"/dev/null"}}
Since the images don't contain any content, I guess this works. But
another possible change would be rewriting the backing file to alternate
between absolute and relative (or even between 'file' and './file') (so
that it's pointing to the same file at all times, just by different names)
> +{"execute":"quit"}
> +EOF
> +
> +TEST_IMG="$TEST_IMG.mid" _img_info
> +
> +echo
> +echo "Change backing file of top (opened writable)"
> +echo
> +
> +TEST_IMG="$TEST_IMG.mid" _make_test_img -b "$TEST_IMG.base"
> +
> +run_qemu -drive if=none,file="$TEST_IMG",node-name=top <<EOF
> +{"execute":"qmp_capabilities"}
> +{"execute":"change-backing-file", "arguments":{"device":"none0","image-node-name":"top","backing-file":"/dev/null"}}
> +{"execute":"quit"}
You've quit qemu between runs. Would we get any further coverage by doing:
change mid
change active
change mid
all within a single run? (That is, make SURE that actions on one part of
the graph don't interfere with later actions elsewhere)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-09-15 19:14 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-15 10:10 [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen Kevin Wolf
2017-09-15 10:10 ` [Qemu-devel] [PATCH 1/6] qemu-io: Reset qemuio_blk permissions before each command Kevin Wolf
2017-09-15 17:44 ` Eric Blake
2017-09-18 7:16 ` Fam Zheng
2017-09-21 13:53 ` Kevin Wolf
2017-09-22 10:46 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-09-22 12:55 ` [Qemu-devel] [PATCH v2 1/6] qemu-io: Drop write permissions before read-only reopen Kevin Wolf
2017-09-22 13:22 ` Fam Zheng
2017-09-15 10:10 ` [Qemu-devel] [PATCH 2/6] block: Add reopen_queue to bdrv_child_perm() Kevin Wolf
2017-09-15 17:51 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 3/6] block: Add reopen queue to bdrv_check_perm() Kevin Wolf
2017-09-15 18:39 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 4/6] block: Base permissions on rw state after reopen Kevin Wolf
2017-09-15 18:58 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 5/6] block: reopen: Queue children after their parents Kevin Wolf
2017-09-15 19:01 ` Eric Blake
2017-09-15 10:10 ` [Qemu-devel] [PATCH 6/6] block: Fix permissions after bdrv_reopen() Kevin Wolf
2017-09-15 19:06 ` Eric Blake
2017-09-18 9:35 ` Kevin Wolf
2017-09-18 7:37 ` Fam Zheng
2017-09-18 7:43 ` Kevin Wolf
2017-09-15 17:02 ` [Qemu-devel] [PATCH 7/6] qemu-iotests: Test change-backing-file command Kevin Wolf
2017-09-15 19:14 ` Eric Blake [this message]
2017-09-18 7:51 ` [Qemu-devel] [PATCH 0/6] block: Fix permissions after ro/rw reopen Fam Zheng
2017-09-18 8:11 ` Kevin Wolf
2017-09-18 11:53 ` Fam Zheng
2017-09-18 12:11 ` Kevin Wolf
2017-09-18 12:32 ` Fam Zheng
2017-09-20 10:33 ` 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=97519d8d-e00e-97f6-aa13-98ba06faca88@redhat.com \
--to=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@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).