From: John Snow <jsnow@redhat.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
Subject: Esoteric QMP specification questions of dubious importance
Date: Fri, 2 Jul 2021 13:14:56 -0400 [thread overview]
Message-ID: <CAFn=p-YDG2BUpt7nm1K78tFMF8dajpYoLvGbK0poHA72rgAPHg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]
I'm writing a "fake" QMP server for the purposes of creating unit tests for
the python QMP library. In doing so, I am left with some esoteric questions:
(1) qemu-spec.txt, section 2.4.2, "error":
The format of an "error response" is:
> { "error": { "class": json-string, "desc": json-string }, "id":
json-value }
For the purposes of naming internal types in the QMP library, does the
"error" object value have a canonical type name? It's not defined in QAPI
that I can see.
(2) qemu-spec.txt, section 2.2 "Server Greeting":
The greeting message format is:
> { "QMP": { "version": json-object, "capabilities": json-array } }
>
> Where,
>
> - The "version" member contains the Server's version information (the
format
> is the same of the query-version command)
The layout of the "version" object is not specified in the spec itself,
though it does ask you to refer to the query-version command.
Hypothetically, is an alternate implementation of QMP in a binary that is
*not* QEMU allowed to change the layout of the "version" object (so long as
it matched whatever format it had for a "query-version" command, also not
mandated by the spec), or must it *always* conform to this precise layout?
(qapi/control.json):
> { 'struct': 'VersionInfo',
> 'data': {'qemu': 'VersionTriple', 'package': 'str'} }
If so, what should such a hypothetical client that is *not* QEMU do here?
What version does it report for the "qemu" VersionTriple member? Can I
report 0.0.0?
(3) Does the qmp-spec technically mandate any commands being available?
I believe that qmp_capabilities is definitively a requirement of the spec,
but what about query-commands, query-version, or quit? Are they technically
requirements of the QMP spec, or just requirements of QEMU?
Weird questions, I know.
--js
[-- Attachment #2: Type: text/html, Size: 2552 bytes --]
next reply other threads:[~2021-07-02 17:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 17:14 John Snow [this message]
2021-07-08 11:10 ` Esoteric QMP specification questions of dubious importance Markus Armbruster
2021-07-13 18:06 ` Eric Blake
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='CAFn=p-YDG2BUpt7nm1K78tFMF8dajpYoLvGbK0poHA72rgAPHg@mail.gmail.com' \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--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).