From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 08/11] qemu-iotests: add no-op streaming test
Date: Fri, 24 Apr 2015 15:19:54 +0200 [thread overview]
Message-ID: <553A42FA.7090503@redhat.com> (raw)
In-Reply-To: <57782138d21e277dddee0fd348a8ba437411bd64.1429875134.git.berto@igalia.com>
On 24.04.2015 13:40, Alberto Garcia wrote:
> This patch updates test_stream_partial() to test that the block-stream
> operation never copies data from the image specified as base.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> tests/qemu-iotests/030 | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
I think it would be better to add this as an own test case. But I won't
oppose adding it as a special case of test_stream_partial either,
because strictly speaking, streaming nothing is a special case of
streaming partially.
> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> index 6e6cb5a..a395a03 100755
> --- a/tests/qemu-iotests/030
> +++ b/tests/qemu-iotests/030
> @@ -94,6 +94,19 @@ class TestSingleDrive(iotests.QMPTestCase):
> def test_stream_partial(self):
> self.assert_no_active_block_jobs()
>
> + # This is a no-op: no data should ever be copied from the base image
> + result = self.vm.qmp('block-stream', device='drive0', base=mid_img)
> + self.assert_qmp(result, 'return', {})
> +
> + self.wait_until_completed()
> +
> + self.assert_no_active_block_jobs()
> +
> + self.assertNotEqual(qemu_io('-f', iotests.imgfmt, '-c', 'map', mid_img),
> + qemu_io('-f', iotests.imgfmt, '-c', 'map', test_img),
> + 'image file map matches backing file after a no-op')
Well, you haven't really proven anything by doing this, except that the
mid_img hasn't been streamed completely into test_img... What you want
to prove is that test_img is empty after streaming, right? This can be
done by either comparing against an empty image specifically created for
this single test, or by comparing the qemu_io map output against
"[ 0] 2048/ 2048 sectors not allocated at
offset 0 bytes (0)\n", which should be the map output for every empty 1
MB image (regardless of format, and so on).
Max
> +
> + # And this is the operation that actually copies data
> result = self.vm.qmp('block-stream', device='drive0', base=backing_img)
> self.assert_qmp(result, 'return', {})
next prev parent reply other threads:[~2015-04-24 13:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 11:40 [Qemu-devel] [PATCH v5 00/11] Support streaming to an intermediate layer Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 01/11] block: keep a list of block jobs Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 02/11] block: allow block jobs in any arbitrary node Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 03/11] block: never cancel a streaming job without running stream_complete() Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 04/11] block: Support streaming to an intermediate layer Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 05/11] block: Add QMP support for " Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 06/11] docs: Document how to stream " Alberto Garcia
2015-04-24 13:11 ` Max Reitz
2015-04-24 13:15 ` Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 07/11] qemu-iotests: fix test_stream_partial() Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 08/11] qemu-iotests: add no-op streaming test Alberto Garcia
2015-04-24 13:19 ` Max Reitz [this message]
2015-04-24 13:55 ` Alberto Garcia
2015-04-24 13:57 ` Max Reitz
2015-04-24 11:40 ` [Qemu-devel] [PATCH 09/11] qemu-iotests: test streaming to an intermediate layer Alberto Garcia
2015-04-24 11:40 ` [Qemu-devel] [PATCH 10/11] qemu-iotests: test block-stream operations in parallel Alberto Garcia
2015-04-24 13:35 ` Max Reitz
2015-04-24 11:40 ` [Qemu-devel] [PATCH 11/11] qemu-iotests: test overlapping block-stream operations Alberto Garcia
2015-04-24 13:38 ` Max Reitz
-- strict thread matches above, loose matches on Subject: below --
2015-04-24 15:01 [Qemu-devel] [PATCH v6 00/11] Support streaming to an intermediate layer Alberto Garcia
2015-04-24 15:01 ` [Qemu-devel] [PATCH 08/11] qemu-iotests: add no-op streaming test Alberto Garcia
2015-04-24 15:19 ` Max Reitz
2015-05-13 13:27 [Qemu-devel] [PATCH v7 00/11] Support streaming to an intermediate layer Alberto Garcia
2015-05-13 13:27 ` [Qemu-devel] [PATCH 08/11] qemu-iotests: add no-op streaming test Alberto Garcia
2015-05-15 2:44 ` Fam Zheng
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=553A42FA.7090503@redhat.com \
--to=mreitz@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.