From: Stefan Hajnoczi <stefanha@gmail.com>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree
Date: Mon, 4 Apr 2016 13:35:08 +0100 [thread overview]
Message-ID: <20160404123508.GA13632@stefanha-x1.localdomain> (raw)
In-Reply-To: <56FE9432.6020905@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2009 bytes --]
On Fri, Apr 01, 2016 at 05:30:58PM +0200, Max Reitz wrote:
> > Does it still serve its purpose if we warn the user that the
> > graph structure can contain little surprises :)?
>
> As I replied to Berto, I think we can come up with some constraints
> about what qemu may do and what it will not do. That way, we will keep
> the flexibility we need and users can still get the information they want.
>
> For instance, I proposed that qemu will never remove explicitly created
> nodes but may always implicitly add nodes. If a user thus encounters an
> unknown and/or unexpected node, it should just skip the node and fall
> through to its "file" child.
>
> I think that fact that implicitly created nodes will always be inserted
> into edges in the BDS graph such that the edge's child will be the
> node's "file" child is something we are able to guarantee.
Another option would be for nodes to have a child alias that dumb
clients use when skipping the node. This way we're not tied to actually
implementing it with bs->file.
One thing we must be careful about is to avoid using parent->child
relationships in QMP APIs because they introduce race conditions:
Imagine a block job that inserts a filter node. If the client wishes to
insert its own node below the filter node we must solve the following
race condition. The client queries the block graph and traverses to
find the parent node. Now it issues a QMP command to insert its node
below the parent. If the block job happens to complete right before the
QMP command is processed, there will be an error because the parent node
no longer exists.
The race conditions must be kept in mind for all APIs we design once we
begin exposing the block graph :(.
I would say it's an error for the client to refer to internal nodes.
QEMU shouldn't allow the client to name internal nodes due to the race
condition issue. Perhaps they shouldn't have an externally visible node
ID/name at all.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2016-04-04 12:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 19:07 [Qemu-devel] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree Max Reitz
2016-03-24 19:07 ` [Qemu-devel] [RFC for-2.7 1/1] " Max Reitz
2016-03-25 2:50 ` Wen Congyang
2016-03-26 16:27 ` Max Reitz
2016-03-25 6:54 ` Wen Congyang
2016-03-26 16:33 ` Max Reitz
2016-03-28 15:25 ` Eric Blake
2016-03-29 15:29 ` Max Reitz
2016-03-29 15:39 ` Eric Blake
2016-03-29 15:43 ` Max Reitz
2016-03-29 15:51 ` [Qemu-devel] [RFC for-2.7 0/1] " Kevin Wolf
2016-03-29 15:56 ` Max Reitz
2016-03-29 16:09 ` Kevin Wolf
2016-03-29 16:10 ` Max Reitz
2016-03-30 12:43 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2016-03-30 14:22 ` Max Reitz
2016-03-31 9:49 ` Stefan Hajnoczi
2016-04-01 15:30 ` Max Reitz
2016-04-04 12:35 ` Stefan Hajnoczi [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=20160404123508.GA13632@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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).