qemu-e2k/docs/devel
Daniel P. Berrangé f2de406f29 docs/devel: document expectations for QAPI data modelling for QMP
Traditionally we have required that newly added QMP commands will model
any returned data using fine grained QAPI types. This is good for
commands that are intended to be consumed by machines, where clear data
representation is very important. Commands that don't satisfy this have
generally been added to HMP only.

In effect the decision of whether to add a new command to QMP vs HMP has
been used as a proxy for the decision of whether the cost of designing a
fine grained QAPI type is justified by the potential benefits.

As a result the commands present in QMP and HMP are non-overlapping
sets, although HMP comamnds can be accessed indirectly via the QMP
command 'human-monitor-command'.

One of the downsides of 'human-monitor-command' is that the QEMU monitor
APIs remain tied into various internal parts of the QEMU code. For
example any exclusively HMP command will need to use 'monitor_printf'
to get data out. It would be desirable to be able to fully isolate the
monitor implementation from QEMU internals, however, this is only
possible if all commands are exclusively based on QAPI with direct
QMP exposure.

The way to achieve this desired end goal is to finese the requirements
for QMP command design. For cases where the output of a command is only
intended for human consumption, it is reasonable to want to simplify
the implementation by returning a plain string containing formatted
data instead of designing a fine grained QAPI data type. This can be
permitted if-and-only-if the command is exposed under the 'x-' name
prefix. This indicates that the command data format is liable to
future change and that it is not following QAPI design best practice.

The poster child example for this would be the 'info registers' HMP
command which returns printf formatted data representing CPU state.
This information varies enourmously across target architectures and
changes relatively frequently as new CPU features are implemented.
It is there as debugging data for human operators, and any machine
usage would treat it as an opaque blob. It is thus reasonable to
expose this in QMP as 'x-query-registers' returning a 'str' field.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-02 15:55:13 +00:00
..
atomics.rst qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
bitops.rst
blkdebug.txt docs/: fix some comment spelling errors 2020-09-17 20:37:13 +02:00
blkverify.txt
block-coroutine-wrapper.rst scripts: add block-coroutine-wrapper.py 2020-10-05 10:59:06 +01:00
build-system.rst configure: automatically parse command line for meson -D options 2021-10-14 09:51:06 +02:00
ci-definitions.rst.inc docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
ci-jobs.rst.inc docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
ci-runners.rst.inc docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
ci.rst docs: name included files ".rst.inc" 2021-10-01 19:04:45 +02:00
clocks.rst clock: Provide builtin multiplier/divider 2021-09-01 11:08:19 +01:00
code-of-conduct.rst docs: link to archived Fedora code of conduct 2021-09-13 13:56:26 +02:00
conflict-resolution.rst docs: Add a QEMU Code of Conduct and Conflict Resolution Policy document 2021-04-01 13:21:02 +02:00
control-flow-integrity.rst Fix typo in CFI build documentation 2021-05-02 17:24:50 +02:00
decodetree.rst decodetree: Extend argument set syntax to allow types 2021-05-01 11:45:35 -07:00
ebpf_rss.rst docs/devel/ebpf_rss.rst: Format literals correctly 2021-08-02 11:42:38 +01:00
fuzzing.rst fuzz: add instructions for building reproducers 2021-03-16 14:30:30 -04:00
index.rst docs/devel: rename file for writing monitor commands 2021-11-02 15:55:13 +00:00
kconfig.rst configure, meson: move CONFIG_IVSHMEM to meson 2021-07-06 08:33:51 +02:00
loads-stores.rst accel/tcg: Add cpu_{ld,st}*_mmu interfaces 2021-10-13 08:09:53 -07:00
lockcnt.txt docs: fix references to docs/devel/atomics.rst 2021-06-02 06:51:09 +02:00
memory.rst
migration.rst docs/devel/migration.rst: Format literals correctly 2021-08-02 11:42:38 +01:00
modules.rst modules: hook up modules.h to docs build 2021-07-09 18:21:33 +02:00
multi-process.rst docs: move notes inside the body of the document 2021-10-01 19:04:45 +02:00
multi-thread-tcg.rst docs/devel: Add a single top-level header to MTTCG's doc 2021-06-25 10:05:36 +01:00
multiple-iothreads.txt
qapi-code-gen.rst qapi: New special feature flag "unstable" 2021-10-29 15:55:52 +02:00
qgraph.rst docs: reorganize qgraph.rst 2021-10-01 19:04:45 +02:00
qom.rst modules: add module_obj() note to QOM docs 2021-07-09 18:20:27 +02:00
qtest.rst libqos/qgraph: format qgraph comments for sphinx documentation 2021-03-09 11:26:31 +01:00
rcu.txt Docs/RCU: Correct sample code of qatomic_rcu_set 2021-01-12 12:38:03 +01:00
replay.txt
reset.rst
s390-dasd-ipl.rst
secure-coding-practices.rst docs/secure-coding-practices: Describe how to use 'null-co' block driver 2021-06-02 14:29:14 +02:00
stable-process.rst
style.rst docs/devel: expand style section of memory management 2021-03-24 14:24:52 +00:00
tcg-icount.rst tcg: Drop gen_io_end() 2021-09-08 11:09:45 +01:00
tcg-plugins.rst docs: reorganize tcg-plugins.rst 2021-10-01 19:04:45 +02:00
tcg.rst docs/devel: Explain in more detail the TB chaining mechanisms 2021-06-13 17:42:40 -07:00
testing.rst docs: reorganize testing.rst 2021-10-01 19:04:45 +02:00
tracing.rst trace: update docs with meson build information 2021-02-01 11:23:04 +00:00
ui.rst ui: add clipboard documentation 2021-05-21 09:42:44 +02:00
vfio-migration.rst docs/devel: Add VFIO device migration documentation 2021-06-18 08:38:04 -06:00
virtio-migration.txt
writing-monitor-commands.rst docs/devel: document expectations for QAPI data modelling for QMP 2021-11-02 15:55:13 +00:00