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,
	Eric Blake <eblake@redhat.com>, Max Reitz <mreitz@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	pbonzini@redhat.com, jsnow@redhat.com
Subject: Re: [Qemu-devel] [PATCH v11 01/19] block: Add bdrv_drain_all_{begin, end}()
Date: Wed, 19 Oct 2016 19:11:20 +0200	[thread overview]
Message-ID: <20161019171120.GH5336@noname.redhat.com> (raw)
In-Reply-To: <99a0ff7379a345ed60a6092866c9a42f667b37b5.1476450059.git.berto@igalia.com>

Am 14.10.2016 um 15:08 hat Alberto Garcia geschrieben:
> bdrv_drain_all() doesn't allow the caller to do anything after all
> pending requests have been completed but before block jobs are
> resumed.
> 
> This patch splits bdrv_drain_all() into _begin() and _end() for that
> purpose. It also adds aio_{disable,enable}_external() calls to disable
> external clients in the meantime.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>

This looks okay as a first step, possibly enough for this series (we'll
have to review this carefully), but it leaves us with a rather limited
version of bdrv_drain_all_begin/end that excludes many useful cases. One
of them is that John wants to use it around QMP transactions.

Specifically, you can't add a new BDS or a new block job in a drain_all
section because then bdrv_drain_all_end() would try to unpause the new
thing even though it has never been paused. Depending on what else we
did with it, this will either corrupt the pause counters or just
directly fail an assertion.

My first thoughts were about how to let an unpause succeed without a
previous pause for these objects, but actually I think this isn't what
we should do. We rather want to actually do the pause instead because
even new BDSes and block jobs should probably start in a quiesced state
when created inside a drain_all section.

This is somewhat similar to attaching a BlockBackend to a drained BDS.
We already take care to immediately quiesce the BB in this case (even
though this isn't very effective because the BB doesn't propagate it
correctly to its users yet...)

Thoughts?
(Paolo, I'm looking at you.)

Kevin

  parent reply	other threads:[~2016-10-19 17:11 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14 13:08 [Qemu-devel] [PATCH v11 00/19] Support streaming to an intermediate layer Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 01/19] block: Add bdrv_drain_all_{begin, end}() Alberto Garcia
2016-10-15  7:28   ` Paolo Bonzini
2016-10-19 17:11   ` Kevin Wolf [this message]
2016-10-20  8:25     ` Alberto Garcia
2016-10-20  9:11       ` Kevin Wolf
2016-10-21 18:55       ` John Snow
2016-10-21 19:03         ` Alberto Garcia
2016-10-21 19:34           ` John Snow
2016-10-24 10:53     ` Paolo Bonzini
2016-10-25 13:39       ` Alberto Garcia
2016-10-25 13:53         ` Paolo Bonzini
2016-10-25 14:38           ` Kevin Wolf
2016-10-25 14:41             ` Paolo Bonzini
2016-10-25 15:03               ` Kevin Wolf
2016-10-25 14:48             ` Alberto Garcia
2016-10-25 14:52               ` Paolo Bonzini
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 02/19] block: Pause all jobs during bdrv_reopen_multiple() Alberto Garcia
2016-10-15  7:28   ` Paolo Bonzini
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 03/19] block: Add block_job_add_bdrv() Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 04/19] block: Use block_job_add_bdrv() in mirror_start_job() Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 05/19] block: Use block_job_add_bdrv() in backup_start() Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 06/19] block: Check blockers in all nodes involved in a block-commit job Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 07/19] block: Block all nodes involved in the block-commit operation Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 08/19] block: Block all intermediate nodes in commit_active_start() Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 09/19] block: Support streaming to an intermediate layer Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 10/19] block: Add QMP support for " Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 11/19] docs: Document how to stream " Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 12/19] qemu-iotests: Test streaming " Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 13/19] qemu-iotests: Test block-stream operations in parallel Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 14/19] qemu-iotests: Test overlapping stream and commit operations Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 15/19] qemu-iotests: Test block-stream and block-commit in parallel Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 16/19] qemu-iotests: Add iotests.supports_quorum() Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 17/19] qemu-iotests: Test streaming to a Quorum child Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 18/19] block: Add 'base-node' parameter to the 'block-stream' command Alberto Garcia
2016-10-14 13:08 ` [Qemu-devel] [PATCH v11 19/19] qemu-iotests: Test the 'base-node' parameter of 'block-stream' Alberto Garcia

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=20161019171120.GH5336@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@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).