On Thu, Jul 08, 2021 at 01:10:46PM +0200, Markus Armbruster wrote: > John Snow <js...@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