mirror_qemu/qapi
Markus Armbruster bf83f04e13 qapi: Fix doc comment checking for commands and events
When a command's 'data' is an object, its doc comment describes the
arguments defined there.  When 'data' names a type, the doc comment
does not describe arguments.  Instead, the doc generator inserts a
pointer to the named type.

An event's doc comment works the same.

We don't actually check doc comments for commands and events.
Instead, QAPISchema._def_command() forwards the doc comment to the
implicit argument type, where it gets checked.  Works because the
check only cares for the implicit argument type's members.

Not only is this needlessly hard to understand, it actually falls
apart in two cases:

* When 'data' is empty, there is nothing to forward to, and the doc
  comment remains unchecked.  Demonstrated by test doc-bad-event-arg.

* When 'data' names a type, we can't forward, as the type has its own
  doc comment.  The command or event's doc comment remains unchecked.
  Demonstrated by test doc-bad-boxed-command-arg.

The forwarding goes back to commit 069fb5b250 "qapi: Prepare for
requiring more complete documentation", put to use in commit
816a57cd6e "qapi: Fix detection of bogus member documentation".  That
fix was incomplete.

To fix this, make QAPISchemaCommand and QAPISchemaEvent check doc
comments, and drop the forwarding of doc comments to implicit argument
types.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191024110237.30963-12-armbru@redhat.com>
2019-10-29 07:35:16 +01:00
..
Makefile.objs qapi: Split error.json off common.json 2019-08-16 13:31:51 +02:00
audio.json audio: add mixing-engine option (documentation) 2019-10-18 08:14:05 +02:00
authz.json authz: add QAuthZList object type for an access control list 2019-02-26 15:32:18 +00:00
block-core.json qapi: add support for blkreplay driver 2019-10-25 15:15:01 +02:00
block.json nbd: fix outdated qapi docs syntax for tls-creds 2019-03-06 11:05:27 -06:00
char.json chardev: add support for authorization for TLS clients 2019-03-11 16:55:52 +01:00
common.json qapi: Move query-target from misc.json to machine.json 2019-08-21 13:24:01 +02:00
crypto.json crypto: Fix defaults in QCryptoBlockCreateOptionsLUKS 2018-12-12 11:16:49 +00:00
dump.json qapi: Split dump.json off misc.json 2019-07-02 13:37:00 +02:00
error.json qapi: Split error.json off common.json 2019-08-16 13:31:51 +02:00
introspect.json qapi: Add feature flags to commands 2019-10-22 13:54:13 +02:00
job.json qapi/job: The next release will be 3.0 2018-06-29 14:20:56 +02:00
machine-target.json qmp: Add "alias-of" field to query-cpu-definitions 2019-07-05 17:08:04 -03:00
machine.json qapi: report the default CPU type for each machine 2019-09-03 14:39:46 -03:00
migration.json migration: Add validate-uuid capability 2019-09-12 11:19:23 +01:00
misc-target.json qapi: Rename target.json to misc-target.json 2019-07-02 13:37:00 +02:00
misc.json qapi: Allow introspecting fix for savevm's cooperation with blockdev 2019-10-22 13:54:14 +02:00
net.json qapi: Fix doc comment checking for commands and events 2019-10-29 07:35:16 +01:00
opts-visitor.c make check-unit: use after free in test-opts-visitor 2019-09-24 11:03:44 +02:00
qapi-clone-visitor.c qapi/qnull: Add own header 2017-11-17 18:21:30 +01:00
qapi-dealloc-visitor.c Include qemu/queue.h slightly less 2019-08-16 13:31:52 +02:00
qapi-schema.json qapi: Clean up member name case checking 2019-09-28 17:17:18 +02:00
qapi-util.c qemu-common: Move qemu_isalnum() etc. to qemu/ctype.h 2019-06-11 20:22:09 +02:00
qapi-visit-core.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qdev.json qapi: Split qom.json and qdev.json off misc.json 2019-07-02 07:19:57 +02:00
qmp-dispatch.c qmp-dispatch: Use CommandNotFound error for disabled commands 2019-09-28 16:51:30 +02:00
qmp-event.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qmp-registry.c qapi: remove qmp_unregister_command() 2019-02-18 14:44:05 +01:00
qobject-input-visitor.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qobject-output-visitor.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qom.json qapi: Split qom.json and qdev.json off misc.json 2019-07-02 07:19:57 +02:00
rdma.json qapi: Define new QMP message for pvrdma 2018-12-22 11:09:56 +02:00
rocker.json qapi: The #optional tag is redundant, drop 2017-03-16 07:13:02 +01:00
run-state.json qmp: Split ShutdownCause host-qmp into quit and system-reset 2018-12-18 07:55:47 +01:00
sockets.json qapi: Add InetSocketAddress member keep-alive 2019-08-15 13:22:13 -05:00
string-input-visitor.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
string-output-visitor.c cutils: Move size_to_str() from "qemu-common.h" to "qemu/cutils.h" 2019-09-19 11:57:34 +02:00
tpm.json qapi: break long lines at 'data' member 2018-12-13 19:20:11 +01:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
trace.json qapi-schema: Improve section headings 2017-09-04 13:09:12 +02:00
transaction.json qapi: implement block-dirty-bitmap-remove transaction action 2019-08-16 16:28:03 -04:00
ui.json input-linux: add shift+shift as a grab toggle 2019-08-21 12:25:46 +02:00