From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com, armbru@redhat.com,
stefanha@redhat.com
Subject: Re: [Qemu-devel] [RFC] QMP design: Fixing query-block and friends
Date: Tue, 27 Jun 2017 11:46:10 -0500 [thread overview]
Message-ID: <71a641e8-4701-58bf-29c5-090f30d59d91@redhat.com> (raw)
In-Reply-To: <20170627163145.GC4792@noname.redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3293 bytes --]
On 06/27/2017 11:31 AM, Kevin Wolf wrote:
> Hi,
>
> I haven't really liked query-block for a long time, but now that
> blockdev-add and -blockdev have settled, it might finally be the time to
> actually do something about it. In fact, if used together with these
> modern interfaces, our query commands are simply broken, so we have to
> fix something.
Agreed.
>
> However, it appears to me that I dislike so many thing about our current
> query commands that I'm tempted to say: Throw it all away and start
> over.
I'm somewhat leaning this direction as well. We have to keep the old
commands for a while longer (if we don't want to break existing
clients), but libvirt has definitely felt some of the pain of how many
commands and parsing are required in tandem to reconstruct which BDS
node name to use for setting threshold events.
>
> If that's what we're going to do, I think I can figure out something
> nice for block nodes. That shouldn't be too hard. The only question
> would be whether we want a command to query one node or whether we would
> keep returning all of them.
The age-old filtering question. It's also plausible to have a single
command, with an optional argument, and which always returns an array:
the full array if the argument was omitted, or an array of one matching
the argument when one was provided. Adding filtering is an easy patch
on top once it is proven to make life easier for a client, and I'm okay
with a first approach that does not filter.
>
> I am, however, a bit less confident about BBs. As I said above, I
> consider them part of the qdev devices. As far as I know, there is no
> high-level infrastructure to query runtime state of devices and qdev
> properties are supposed to be read-only. Maybe non-qdev QOM properties
> can be used somehow? But QOM isn't really nice to use as you need to
> query each property individually.
>
> Another option would be to have a QMP command that takes a qdev ID of a
> block device and queries its BB. Or maybe it should stay like
> query-block and return an array of all of them, but include the qdev
> device name. Actually, maybe query-block can stay as it contains only
> two fields that are useless in the new world.
Being able to query all the devices (with their BB's, and only a name
reference to the top-level BDS in use by the BB), separately from being
able to query all BDS, seems like a reasonable thing. After all,
sometimes you care about what the guest sees (what devices have a BB),
and sometimes you care about what the host is exposing (what BDS are in
use).
> I think this has become long enough now, so any opinions? On anything I
> said above, but preferably also about what a new interface should look
> like?
Our existing interface is definitely awkward, with lots of redundancy in
some places and missing information in others, and a new interface does
seem like we can do better at designing it right up front rather than
bolting on yet more information to the existing queries (which results
in that much more noise to churn through to get to the desired information).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-06-27 16:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 16:31 [Qemu-devel] [RFC] QMP design: Fixing query-block and friends Kevin Wolf
2017-06-27 16:46 ` Eric Blake [this message]
2017-06-28 7:10 ` Markus Armbruster
2017-06-28 10:06 ` Kevin Wolf
2017-06-28 11:59 ` Markus Armbruster
2017-06-27 18:24 ` [Qemu-devel] [Qemu-block] " John Snow
2017-06-28 7:15 ` Markus Armbruster
2017-06-28 16:00 ` John Snow
2017-06-29 7:23 ` Markus Armbruster
2017-07-05 14:53 ` Stefan Hajnoczi
2017-06-30 13:01 ` Alberto Garcia
2017-06-30 14:22 ` Kevin Wolf
2017-06-30 14:30 ` Alberto Garcia
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=71a641e8-4701-58bf-29c5-090f30d59d91@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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).