From: Max Reitz <mreitz@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Qemu-block <qemu-block@nongnu.org>, Qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Drainage in bdrv_replace_child_noperm()
Date: Wed, 8 Nov 2017 20:39:52 +0100 [thread overview]
Message-ID: <0dca5e3b-eded-abf0-86dd-36073710e792@redhat.com> (raw)
In-Reply-To: <20171107052111.GB16355@lemon>
[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]
On 2017-11-07 06:21, Fam Zheng wrote:
> On Mon, 11/06 19:49, Max Reitz wrote:
[...]
>> I have two ideas:
>>
>> One is to assume that (un-)draining a parent will always (un-)drain all
>> children, including the one the (un-)drain comes from. This assumption
>> seems wrong, see [1], but maybe it isn't. Anyway, if so, we could just
>> explicitly drain the new child in bdrv_replace_child_noperm() after
>> having drained the parent and thus get a consistent state again.
>>
>> The other is to declare (A) wrong. Maybe when
>> BdrvChildRole.drained_{begin,end}() is invoked, we should not drain that
>> child because we can declare it the caller's responsibility to make sure
>> it's drained. This seems logical to me because usually those methods
>> are invoked when the child is drained anyway. But maybe I'm wrong. :-)
>
> I'm in favor of asking the caller to make sure all nodes involved in the graph
> manupulation are drained, it feels comparably easier to do, than fixing the
> problem in bdrv_append().
I guess my main question was whether any of the two approaches is
evidently wrong in some way, but if you don't say that (and Kevin says
the first is wrong), I'm going to assume doing the second is OK. :-)
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
next prev parent reply other threads:[~2017-11-08 19:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-06 18:49 [Qemu-devel] Drainage in bdrv_replace_child_noperm() Max Reitz
2017-11-07 5:21 ` Fam Zheng
2017-11-08 19:39 ` Max Reitz [this message]
2017-11-07 14:22 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2017-11-08 20:16 ` Max Reitz
2017-11-09 16:25 ` 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=0dca5e3b-eded-abf0-86dd-36073710e792@redhat.com \
--to=mreitz@redhat.com \
--cc=famz@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).