qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: John Snow <jsnow@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: Esoteric QMP specification questions of dubious importance
Date: Tue, 13 Jul 2021 13:06:02 -0500	[thread overview]
Message-ID: <20210713180602.uqyzshxc6qcvtius@redhat.com> (raw)
In-Reply-To: <87a6mx83ih.fsf@dusky.pond.sub.org>

On Thu, Jul 08, 2021 at 01:10:46PM +0200, Markus Armbruster wrote:
> John Snow <jsnow@redhat.com> writes:
> 
> > 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.
> 
> No, it isn't.  It's built manually from an Error object in
> qmp_error_response():
> 
>     rsp = qdict_from_jsonf_nofail("{ 'error': { 'class': %s, 'desc': %s } }",
>                                   QapiErrorClass_str(error_get_class(err)),
>                                   error_get_pretty(err));

If we _need_ it to appear in the QAPI, it should certainly be
possible.  So far, no one has presented a need, but your unit tester
may be the reason to codify it.

> 
> > Weird questions, I know.
> 
> There are no weird questions, only weird people ;-P

Hey, I resemble that remark ;)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



      reply	other threads:[~2021-07-13 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 17:14 Esoteric QMP specification questions of dubious importance John Snow
2021-07-08 11:10 ` Markus Armbruster
2021-07-13 18:06   ` Eric Blake [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=20210713180602.uqyzshxc6qcvtius@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jsnow@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).