qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-block@nongnu.org, famz@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 16/19] block: Allow graph changes in subtree drained section
Date: Wed, 20 Dec 2017 12:18:22 +0100	[thread overview]
Message-ID: <20171220111822.GA6374@localhost.localdomain> (raw)
In-Reply-To: <974e7f62-412a-21e8-d502-a0e7a99015cc@redhat.com>

Am 20.12.2017 um 11:51 hat Paolo Bonzini geschrieben:
> On 20/12/2017 11:34, Kevin Wolf wrote:
> >      .inherit_options = bdrv_inherited_options,
> >      .drained_begin   = bdrv_child_cb_drained_begin,
> >      .drained_end     = bdrv_child_cb_drained_end,
> > +    .attach          = bdrv_child_cb_attach,
> > +    .detach          = bdrv_child_cb_detach,
> >      .inactivate      = bdrv_child_cb_inactivate,
> >  };
> >  
> > @@ -911,6 +933,8 @@ const BdrvChildRole child_format = {
> >      .inherit_options = bdrv_inherited_fmt_options,
> >      .drained_begin   = bdrv_child_cb_drained_begin,
> >      .drained_end     = bdrv_child_cb_drained_end,
> > +    .attach          = bdrv_child_cb_attach,
> > +    .detach          = bdrv_child_cb_detach,
> >      .inactivate      = bdrv_child_cb_inactivate,
> 
> Is there any case of a BdrvChildRole that doesn't want these callbacks?
> Maybe the functions should be called after ->attach and before ->detach
> (e.g. bdrv_{,un}apply_subtree_drain), rather than modifying the
> BdrvChildRole implementations.

At first I intended to implement it directly in
bdrv_replace_child_noperm(), but the thing is that you need the
bs->recursive_quiesce_counter of the parent BDS - but not all parents of
a BdrvChild are even a BDS. It could also be a BB root child or a block
job child. This is why we only have a void *opaque rather than a BDS
pointer for the parent.

The other option would be an additional BdrvChildRole callback like
.get_recursive_quiesce_counter, but compared to that, I like some code
in .attach/.detach better.

> Then they can be put in block/io.c, and bdrv_do_drained_* can remain
> static.  (I would also consider extracting block/drain.c, but it is
> painful to do it now that you have this nice series---so let's do it after).

I can keep that in mind for part 3 (or 4, whatever it may become).

Kevin

  reply	other threads:[~2017-12-20 11:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 10:33 [Qemu-devel] [PATCH 00/19] Drain fixes and cleanups, part 2 Kevin Wolf
2017-12-20 10:33 ` [Qemu-devel] [PATCH 01/19] block: Remove unused bdrv_requests_pending Kevin Wolf
2017-12-20 10:33 ` [Qemu-devel] [PATCH 02/19] block: Assert drain_all is only called from main AioContext Kevin Wolf
2017-12-20 12:14   ` Fam Zheng
2017-12-20 10:33 ` [Qemu-devel] [PATCH 03/19] block: Make bdrv_drain() driver callbacks non-recursive Kevin Wolf
2017-12-20 13:16   ` Fam Zheng
2017-12-20 13:24     ` Kevin Wolf
2017-12-20 13:31       ` Fam Zheng
2017-12-20 10:33 ` [Qemu-devel] [PATCH 04/19] test-bdrv-drain: Test callback for bdrv_drain Kevin Wolf
2017-12-20 10:33 ` [Qemu-devel] [PATCH 05/19] test-bdrv-drain: Test bs->quiesce_counter Kevin Wolf
2017-12-20 10:33 ` [Qemu-devel] [PATCH 06/19] blockjob: Pause job on draining any job BDS Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 07/19] test-bdrv-drain: Test drain vs. block jobs Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 08/19] block: Don't block_job_pause_all() in bdrv_drain_all() Kevin Wolf
2017-12-21 23:24   ` Eric Blake
2017-12-20 10:34 ` [Qemu-devel] [PATCH 09/19] block: Nested drain_end must still call callbacks Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 10/19] test-bdrv-drain: Test nested drain sections Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 11/19] block: Don't notify parents in drain call chain Kevin Wolf
2017-12-21 23:26   ` Eric Blake
2017-12-20 10:34 ` [Qemu-devel] [PATCH 12/19] block: Add bdrv_subtree_drained_begin/end() Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 13/19] test-bdrv-drain: Tests for bdrv_subtree_drain Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 14/19] test-bdrv-drain: Test behaviour in coroutine context Kevin Wolf
2017-12-20 10:53   ` Paolo Bonzini
2017-12-20 10:34 ` [Qemu-devel] [PATCH 15/19] test-bdrv-drain: Recursive draining with multiple parents Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 16/19] block: Allow graph changes in subtree drained section Kevin Wolf
2017-12-20 10:51   ` Paolo Bonzini
2017-12-20 11:18     ` Kevin Wolf [this message]
2017-12-20 11:31       ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2017-12-20 13:04         ` Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 17/19] test-bdrv-drain: Test graph changes in " Kevin Wolf
2017-12-20 10:34 ` [Qemu-devel] [PATCH 18/19] commit: Simplify reopen of base Kevin Wolf
2017-12-20 13:32   ` Fam Zheng
2017-12-20 10:34 ` [Qemu-devel] [PATCH 19/19] block: Keep nodes drained between reopen_queue/multiple Kevin Wolf
2017-12-20 13:34   ` Fam Zheng
2017-12-20 10:54 ` [Qemu-devel] [PATCH 00/19] Drain fixes and cleanups, part 2 Paolo Bonzini

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=20171220111822.GA6374@localhost.localdomain \
    --to=kwolf@redhat.com \
    --cc=famz@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).