From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Fam Zheng <famz@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] Can we make monitor commands identify BDS / BB by name consistently? (was: Review of monitor commands identifying BDS / BB by name)
Date: Wed, 17 Dec 2014 15:12:15 +0100 [thread overview]
Message-ID: <20141217141215.GA3303@noname.str.redhat.com> (raw)
In-Reply-To: <87zjan1n11.fsf@blackfin.pond.sub.org>
Am 16.12.2014 um 19:12 hat Markus Armbruster geschrieben:
> Conscious design decision: Backend (BB) and node (BDS) names share a
> common name space.
>
> Enables a convenience feature: when a command needs a node, we accept
> either kind of name, and a backend name is resolved to its root node.
>
> Should not be confused with a command that can work either on a backend
> or on a node. There, a backend name resolves to the backend, not its
> root node. Can't point to an example offhand.
>
> Let's concentrate on the "command needs a node" case.
>
> As we saw in my review of monitor commands, we have two different
> conventions there.
>
> * Single name
>
> Within BlockdevOptions objects (used by blockdev-add), we use a single
> string member, with a name that explains its role. Actually, the
> member is an anonymous union of string and BlockdevOptions.
>
> Example: a BlockdevOptionsGenericFormat object (used for format "raw"
> and others) has a member @file that may name a backend or a node.
>
> Example: a BlockdevOptionsQcow2 object (used for "qcow2"), has a
> member @file as above, and a member @backing that may again name a
> backend or a node.
>
> * Pair of names
>
> Elsewhere, command argument objects have a pair of optional members,
> of which exactly one must be present. One of them must name a
> backend, the other must name a node. The former is commonly called
> @device, the latter @node-name.
>
> Example: block_passwd parameters @device and @node-name.
>
> I'd very much like some consistency here.
>
> As Kevin pointed out, you can't easily change BlockdevOptions to the
> "pair of names" convention, because an anonymous union can have only one
> object member, and that's taken by BlockdevOptions. If you want us to
> adopt the "pair of names" convention, you need to come up with a way to
> use it with BlockdevOptions.
>
> I want us to adopt the "single name" convention instead. Therefore, I
> need to come up with a way to use it with the command argument objects
> that currently use "pair of names". The problems there are
> compatibility and discoverability.
>
> Four ways come to mind:
>
> 1. Extend @node-name to accept backend names, deprecate @device
>
> @node-name becomes mandatory except in deprecated usage.
> Nevertheless, it remains optional in the schema, which is confusing.
>
> For discovery, you first have to try whether the command accepts
> parameter @node-name. If no, you have a QEMU predating node names,
> and you need to use @device. If yes, you need to try whether the
> command accepts a backend name as argument for @node-name. Involves
> defining a backend. Awkward.
>
> 2. Extend @device to accept node names, deprecate @node-name
>
> @device becomes mandatory except in deprecated usage. Nevertheless,
> it remains optional in the schema, which is confusing.
Actually, I think we may consider that device used to be mandatory until
recently. Management tools should be able to cope with it. If we make it
mandatory again, we may just look like an older qemu version - would
that be that bad?
> We're stuck with a bad parameter name: @device.
>
> For discovery, you need to try whether the command accepts a node
> name as argument for @device. Involves defining a node. Almost as
> awkward.
>
> 3. Add a new parameter, deprecate both old ones
>
> The new parameter is mandatory except in deprecated usage.
> Nevertheless, it's optional in the schema, which is confusing.
>
> Discovery needs to check which of the parameters the command accepts.
> Less awkward.
>
> 4. Add a new command, deprecate the old one
>
> Quick search for commands to deprecate: block_passwd, block_resize,
> blockdev-snapshot-sync. Not really bad.
>
> Discovery needs to check query-commands for the new command. Easy.
>
> Any objections to #4?
The first two don't match the wanted pattern for block layer
commands anyway, so blockdev-passwd and blockdev-resize seems like an
improvement.
blockdev-snapshot-sync should probably be replaced by a "real blockdev"
command that adds a snapshot into the tree without actually creating the
BDS, i.e. you need to use blockdev-add first. This solves the problem
that currently you can't specify any bdrv_open() options when taking a
snapshot.
Kevin
next prev parent reply other threads:[~2014-12-17 14:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 19:06 [Qemu-devel] Review of monitor commands identifying BDS / BB by name Markus Armbruster
2014-12-03 5:52 ` Fam Zheng
2014-12-03 11:13 ` Paolo Bonzini
2014-12-04 15:59 ` Markus Armbruster
2014-12-03 10:30 ` Kevin Wolf
2014-12-03 13:59 ` Eric Blake
2014-12-03 14:51 ` Markus Armbruster
2014-12-04 16:56 ` Markus Armbruster
2014-12-04 15:56 ` Markus Armbruster
2014-12-04 19:44 ` Eric Blake
2014-12-05 9:19 ` Kevin Wolf
2014-12-05 12:19 ` Markus Armbruster
2014-12-05 9:34 ` Markus Armbruster
2014-12-05 9:46 ` Kevin Wolf
2014-12-05 12:08 ` Markus Armbruster
2014-12-16 18:12 ` [Qemu-devel] Can we make monitor commands identify BDS / BB by name consistently? (was: Review of monitor commands identifying BDS / BB by name) Markus Armbruster
2014-12-17 14:12 ` Kevin Wolf [this message]
2014-12-17 16:17 ` [Qemu-devel] Can we make monitor commands identify BDS / BB by name consistently? Markus Armbruster
2014-12-19 18:27 ` Markus Armbruster
2014-12-18 15:25 ` [Qemu-devel] Review of ways to create BDSes (was: Review of monitor commands identifying BDS / BB by name) Markus Armbruster
2014-12-19 12:18 ` Kevin Wolf
2014-12-19 14:02 ` [Qemu-devel] Review of ways to create BDSes Markus Armbruster
2014-12-19 14:24 ` Markus Armbruster
2014-12-19 15:52 ` [Qemu-devel] Review of ways to reopen BDSes (was: Review of monitor commands identifying BDS / BB by name) Markus Armbruster
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=20141217141215.GA3303@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--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).