qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Alberto Garcia <berto@igalia.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Max Reitz <mreitz@redhat.com>, Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v12 15/19] qemu-iotests: Test block-stream and block-commit in parallel
Date: Thu, 27 Oct 2016 17:54:52 +0200	[thread overview]
Message-ID: <20161027155451.GG4027@noname.redhat.com> (raw)
In-Reply-To: <fc6f720895cc2a0145daa15342bad8a2ebc9fd76.1477476553.git.berto@igalia.com>

Am 26.10.2016 um 12:29 hat Alberto Garcia geschrieben:
> As with test_stream_parallel(), we allow mixing block-stream and
> block-commit operations in the same backing chain as long as there's
> no overlap among the involved nodes.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  tests/qemu-iotests/030     | 30 ++++++++++++++++++++++++++++++
>  tests/qemu-iotests/030.out |  4 ++--
>  2 files changed, 32 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
> index e3bded8..d88823a 100755
> --- a/tests/qemu-iotests/030
> +++ b/tests/qemu-iotests/030
> @@ -315,6 +315,36 @@ class TestParallelOps(iotests.QMPTestCase):
>          self.assert_qmp(result, 'return', {})
>  
>          self.wait_until_completed(drive='commit-drive0')
> +
> +    # Test a block-stream and a block-commit job in parallel
> +    def test_stream_commit(self):
> +        self.assertLessEqual(8, self.num_imgs)
> +        self.assert_no_active_block_jobs()
> +
> +        # Stream from node0 into node2
> +        result = self.vm.qmp('block-stream', device='node2', job_id='node2')
> +        self.assert_qmp(result, 'return', {})
> +
> +        # Commit from the active layer into node3
> +        result = self.vm.qmp('block-commit', device='drive0', top=self.imgs[5], base=self.imgs[3])
> +        self.assert_qmp(result, 'return', {})

I'm not sure what you wanted to test here (active commit/mirror or
normal commit), but the comment and what you really do don't match. This
doesn't use the active layer...

> +        # Wait for all jobs to be finished.
> +        pending_jobs = ['node2', 'drive0']
> +        while len(pending_jobs) > 0:
> +            for event in self.vm.get_qmp_events(wait=True):
> +                if event['event'] == 'BLOCK_JOB_COMPLETED':
> +                    node_name = self.dictpath(event, 'data/device')
> +                    self.assertTrue(node_name in pending_jobs)
> +                    self.assert_qmp_absent(event, 'data/error')
> +                    pending_jobs.remove(node_name)
> +                if event['event'] == 'BLOCK_JOB_READY':
> +                    self.assert_qmp(event, 'data/device', 'drive0')
> +                    self.assert_qmp(event, 'data/type', 'commit')
> +                    self.assert_qmp_absent(event, 'data/error')
> +                    self.assertTrue('drive0' in pending_jobs)
> +                    self.vm.qmp('block-job-complete', device='drive0')

...so the BLOCK_JOB_READY handling is dead code because we're not using
a mirror job internally.

>          self.assert_no_active_block_jobs()
>  
>  class TestSmallerBackingFile(iotests.QMPTestCase):

Kevin

  reply	other threads:[~2016-10-27 15:55 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 10:29 [Qemu-devel] [PATCH v12 00/19] Support streaming to an intermediate layer Alberto Garcia
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 01/19] block: Add bdrv_drain_all_{begin, end}() Alberto Garcia
2016-10-26 14:35   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 02/19] block: Pause all jobs during bdrv_reopen_multiple() Alberto Garcia
2016-10-26 14:36   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 03/19] block: Add block_job_add_bdrv() Alberto Garcia
2016-10-26 14:36   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 04/19] block: Use block_job_add_bdrv() in mirror_start_job() Alberto Garcia
2016-10-26 14:40   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 05/19] block: Use block_job_add_bdrv() in backup_start() Alberto Garcia
2016-10-26 14:41   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 06/19] block: Check blockers in all nodes involved in a block-commit job Alberto Garcia
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 07/19] block: Block all nodes involved in the block-commit operation Alberto Garcia
2016-10-26 14:49   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 08/19] block: Block all intermediate nodes in commit_active_start() Alberto Garcia
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 09/19] block: Support streaming to an intermediate layer Alberto Garcia
2016-10-26 14:52   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 10/19] block: Add QMP support for " Alberto Garcia
2016-10-26 14:58   ` Kevin Wolf
2016-10-26 17:23     ` Alberto Garcia
2016-10-27  8:58       ` Kevin Wolf
2016-10-27 10:08         ` Alberto Garcia
2016-10-27 14:46         ` Eric Blake
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 11/19] docs: Document how to stream " Alberto Garcia
2016-10-26 15:01   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 12/19] qemu-iotests: Test streaming " Alberto Garcia
2016-10-27 15:13   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 13/19] qemu-iotests: Test block-stream operations in parallel Alberto Garcia
2016-10-27 15:23   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 14/19] qemu-iotests: Test overlapping stream and commit operations Alberto Garcia
2016-10-27 15:36   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 15/19] qemu-iotests: Test block-stream and block-commit in parallel Alberto Garcia
2016-10-27 15:54   ` Kevin Wolf [this message]
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 16/19] qemu-iotests: Add iotests.supports_quorum() Alberto Garcia
2016-10-27 15:56   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 17/19] qemu-iotests: Test streaming to a Quorum child Alberto Garcia
2016-10-27 16:03   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 18/19] block: Add 'base-node' parameter to the 'block-stream' command Alberto Garcia
2016-10-27 16:09   ` Kevin Wolf
2016-10-26 10:29 ` [Qemu-devel] [PATCH v12 19/19] qemu-iotests: Test the 'base-node' parameter of 'block-stream' Alberto Garcia
2016-10-27 16:13   ` 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=20161027155451.GG4027@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.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).