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, jcody@redhat.com,
	qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 00/17] block: Convert common I/O path to BdrvChild
Date: Tue, 21 Jun 2016 12:56:20 +0200	[thread overview]
Message-ID: <20160621105620.GD4520@noname.redhat.com> (raw)
In-Reply-To: <3f872c08-06d8-d755-9369-02ecd0d6d000@redhat.com>

Am 21.06.2016 um 11:47 hat Paolo Bonzini geschrieben:
> 
> 
> On 21/06/2016 11:21, Kevin Wolf wrote:
> > This series converts all I/O function in the core block layer up to
> > bdrv_co_preadv/pwritev() to taking a BdrvChild as their first parameter
> > instead of a BlockDriverState.
> > 
> > The original motivation for this change were op blockers, where one of
> > the biggest problems is making sure that every user of block devices
> > actually registers correctly with the op blockers system. If the I/O
> > functions know which parent a request comes from (BdrvChild basically
> > corresponds to an edge in our block device graph), it can use assertions
> > to make sure that that parent has actually registered its activities and
> > thereby ensured that it doesn't conflict with other users.
> > 
> > There are, however, more benefits we get from this change. The most
> > important one is probably that it enforces important aspects of the
> > block layer design like that external users go through a BlockBackend
> > and request are internally routed along the edges of the graph. Accesses
> > to random BDSes are no longer possible, you need to own an actual child
> > reference so you can make a request.
> 
> I still fail to understand what is the rationale for this change.  The
> API is weird; you read from a disk, not from an edge, and in fact the
> first thing all the APIs do is dereference the BdrvChild...
> 
> The assertions are nice, but I'm not sure it's a good idea to design a
> whole API around them.

Do you see a problem with such an API, though? If there is no reason not
to have the advantages, as small as they may seem, why not take them?

(By the way, I disagree that assertions for op blockers are just "nice
to have". I would never be confident that we covered everything without
them.)

Apart from that, I actually think the conversion has already done its
most important job, which is uncovering the places where we employed
hacks that violate our design. With this series compiling and working,
I'm even confident to say that everything that should be using
BlockBackend, does so by now (now = with the series applied).

But now that the patches exist, even if you dismiss the value of op
blocker assertions, applying them in order to keep us honest to the
design even in the future seems appealing to me.

Well, unless you show me an example of something that makes sense, is
compatible with the block layer design and would still be incorrectly
blocked by the requirement to have a BdrvChild. Then I might change my
opinion.

Kevin

  reply	other threads:[~2016-06-21 10:56 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  9:21 [Qemu-devel] [PATCH 00/17] block: Convert common I/O path to BdrvChild Kevin Wolf
2016-06-21  9:21 ` [Qemu-devel] [PATCH 01/17] vvfat: Use BdrvChild for s->qcow Kevin Wolf
2016-06-22 16:54   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 02/17] blkreplay: Convert to byte-based I/O Kevin Wolf
2016-06-22 17:03   ` Max Reitz
2016-06-22 17:15   ` Eric Blake
2016-06-21  9:21 ` [Qemu-devel] [PATCH 03/17] vhdx: Some more BlockBackend use in vhdx_create() Kevin Wolf
2016-06-22 17:08   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 04/17] block: Convert bdrv_co_readv() to BdrvChild Kevin Wolf
2016-06-25 15:07   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 05/17] block: Convert bdrv_co_writev() " Kevin Wolf
2016-06-25 15:14   ` Max Reitz
2016-06-27  8:56     ` Kevin Wolf
2016-06-21  9:21 ` [Qemu-devel] [PATCH 06/17] block: Convert bdrv_aio_readv() " Kevin Wolf
2016-06-25 15:16   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 07/17] block: Convert bdrv_aio_writev() " Kevin Wolf
2016-06-25 15:20   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 08/17] block: Convert bdrv_co_do_readv/writev " Kevin Wolf
2016-06-25 15:26   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 09/17] block: Move bdrv_commit() to block/commit.c Kevin Wolf
2016-06-24 15:37   ` Eric Blake
2016-06-21  9:21 ` [Qemu-devel] [PATCH 10/17] block: Use BlockBackend for I/O in bdrv_commit() Kevin Wolf
2016-06-25 15:34   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 11/17] block: Convert bdrv_read() to BdrvChild Kevin Wolf
2016-06-27 13:24   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 12/17] block: Convert bdrv_write() " Kevin Wolf
2016-06-27 13:44   ` Max Reitz
2016-06-27 13:47     ` Max Reitz
2016-06-29 12:11       ` [Qemu-devel] [PATCH v2 " Kevin Wolf
2016-06-29 15:22         ` Max Reitz
2016-06-29 15:33           ` Kevin Wolf
2016-06-29 15:37             ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 13/17] block: Convert bdrv_pread(v) " Kevin Wolf
2016-06-27 14:55   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 14/17] block: Convert bdrv_pwrite(v/_sync) " Kevin Wolf
2016-06-27 15:07   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 15/17] block: Convert bdrv_pwrite_zeroes() " Kevin Wolf
2016-06-27 15:12   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 16/17] block: Convert bdrv_prwv_co() " Kevin Wolf
2016-06-27 15:19   ` Max Reitz
2016-06-21  9:21 ` [Qemu-devel] [PATCH 17/17] block: Convert bdrv_co_preadv/pwritev " Kevin Wolf
2016-06-21  9:47 ` [Qemu-devel] [PATCH 00/17] block: Convert common I/O path " Paolo Bonzini
2016-06-21 10:56   ` Kevin Wolf [this message]
2016-06-21 11:01     ` Paolo Bonzini
2016-06-21 11:31       ` Kevin Wolf
2016-06-22  8:37         ` Fam Zheng
2016-06-28 13:28 ` Stefan Hajnoczi
2016-06-29 11:58   ` 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=20160621105620.GD4520@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@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).