qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] iotests: Test cancelling a job and closing the VM
Date: Wed, 22 May 2019 16:31:17 +0200	[thread overview]
Message-ID: <c5a3333f-c9d4-8e89-43f1-2cd50dc93fee@redhat.com> (raw)
In-Reply-To: <20190522142854.22983-3-mreitz@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]

On 22.05.19 16:28, Max Reitz wrote:
> This patch adds a test where we cancel a throttled mirror job and
> immediately close the VM before it can be cancelled.  Doing so will
> invoke bdrv_drain_all() while the mirror job tries to drain the
> throttled node.  When bdrv_drain_all_end() tries to lift its drain on
> the throttle node, the job will exit and replace the current root node
> of the BB drive0 (which is the job's filter node) by the throttle node.
> Before the previous patch, this replacement did not increase drive0's
> quiesce_counter by a sufficient amount, so when
> bdrv_parent_drained_end() (invoked by bdrv_do_drained_end(), invoked by
> bdrv_drain_all_end()) tried to end the drain on all of the throttle
> node's parents, it decreased drive0's quiesce_counter below 0 -- which
> fails an assertion.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  tests/qemu-iotests/255     | 54 ++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/255.out | 24 +++++++++++++++++
>  2 files changed, 78 insertions(+)
> 
> diff --git a/tests/qemu-iotests/255 b/tests/qemu-iotests/255
> index c0bb37a9b0..b1bbe3ff0a 100755
> --- a/tests/qemu-iotests/255
> +++ b/tests/qemu-iotests/255
> @@ -35,6 +35,10 @@ def blockdev_create(vm, options):
>          vm.run_job('job0')
>      iotests.log("")
>  
> +iotests.log('Finishing a commit job with background reads')
> +iotests.log('============================================')
> +iotests.log('')
> +
>  with iotests.FilePath('t.qcow2') as disk_path, \
>       iotests.FilePath('t.qcow2.mid') as mid_path, \
>       iotests.FilePath('t.qcow2.base') as base_path, \
> @@ -80,4 +84,54 @@ with iotests.FilePath('t.qcow2') as disk_path, \
>      vm.run_job('job0', auto_finalize=False, pre_finalize=start_requests,
>                  auto_dismiss=True)
>  
> +    #vm.qmp_log('block-job-cancel', device='job0')
> +
> +    vm.shutdown()

Er, oops, I took so much time with the commit messages that I forgot
this.  Let me try again...

Shamefully,

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2019-05-22 14:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 14:28 [Qemu-devel] [PATCH 0/2] block/io: Delay decrementing the quiesce_counter Max Reitz
2019-05-22 14:28 ` [Qemu-devel] [PATCH 1/2] " Max Reitz
2019-05-22 14:28 ` [Qemu-devel] [PATCH 2/2] iotests: Test cancelling a job and closing the VM Max Reitz
2019-05-22 14:31   ` Max Reitz [this message]

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=c5a3333f-c9d4-8e89-43f1-2cd50dc93fee@redhat.com \
    --to=mreitz@redhat.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 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).