qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qapi: Split control.json off misc.json

misc.json contains definitions that are related to the system emulator,
so it can't be used for other tools like the storage daemon. This patch
moves basic functionality that is shared between all tools (and mostly
related to the monitor itself) into a new control.json, which could be
used in tools as well.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200129102239.31435-3-kwolf@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>

authored by

Kevin Wolf and committed by
Markus Armbruster
fa4dcf57 c3e95551

+229 -217
+1
monitor/hmp-cmds.c
··· 31 31 #include "qapi/qapi-builtin-visit.h" 32 32 #include "qapi/qapi-commands-block.h" 33 33 #include "qapi/qapi-commands-char.h" 34 + #include "qapi/qapi-commands-control.h" 34 35 #include "qapi/qapi-commands-migration.h" 35 36 #include "qapi/qapi-commands-misc.h" 36 37 #include "qapi/qapi-commands-net.h"
+1
monitor/misc.c
··· 67 67 #include "qemu/thread.h" 68 68 #include "block/qapi.h" 69 69 #include "qapi/qapi-commands-char.h" 70 + #include "qapi/qapi-commands-control.h" 70 71 #include "qapi/qapi-commands-migration.h" 71 72 #include "qapi/qapi-commands-misc.h" 72 73 #include "qapi/qapi-commands-qom.h"
+1
monitor/monitor-internal.h
··· 27 27 28 28 #include "chardev/char-fe.h" 29 29 #include "monitor/monitor.h" 30 + #include "qapi/qapi-types-control.h" 30 31 #include "qapi/qmp/dispatch.h" 31 32 #include "qapi/qmp/json-parser.h" 32 33 #include "qemu/readline.h"
+1
monitor/qmp-cmds.c
··· 32 32 #include "sysemu/block-backend.h" 33 33 #include "qapi/error.h" 34 34 #include "qapi/qapi-commands-block-core.h" 35 + #include "qapi/qapi-commands-control.h" 35 36 #include "qapi/qapi-commands-machine.h" 36 37 #include "qapi/qapi-commands-misc.h" 37 38 #include "qapi/qapi-commands-ui.h"
+1 -1
monitor/qmp.c
··· 27 27 #include "chardev/char-io.h" 28 28 #include "monitor-internal.h" 29 29 #include "qapi/error.h" 30 - #include "qapi/qapi-commands-misc.h" 30 + #include "qapi/qapi-commands-control.h" 31 31 #include "qapi/qmp/qdict.h" 32 32 #include "qapi/qmp/qjson.h" 33 33 #include "qapi/qmp/qlist.h"
+3 -3
qapi/Makefile.objs
··· 5 5 util-obj-y += qmp-event.o 6 6 util-obj-y += qapi-util.o 7 7 8 - QAPI_COMMON_MODULES = audio authz block-core block char common crypto 9 - QAPI_COMMON_MODULES += dump error introspect job machine migration misc net 10 - QAPI_COMMON_MODULES += qdev qom rdma rocker run-state sockets tpm 8 + QAPI_COMMON_MODULES = audio authz block-core block char common control crypto 9 + QAPI_COMMON_MODULES += dump error introspect job machine migration misc 10 + QAPI_COMMON_MODULES += net qdev qom rdma rocker run-state sockets tpm 11 11 QAPI_COMMON_MODULES += trace transaction ui 12 12 QAPI_TARGET_MODULES = machine-target misc-target 13 13 QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
+218
qapi/control.json
··· 1 + # -*- Mode: Python -*- 2 + # 3 + 4 + ## 5 + # = QMP monitor control 6 + ## 7 + 8 + ## 9 + # @qmp_capabilities: 10 + # 11 + # Enable QMP capabilities. 12 + # 13 + # Arguments: 14 + # 15 + # @enable: An optional list of QMPCapability values to enable. The 16 + # client must not enable any capability that is not 17 + # mentioned in the QMP greeting message. If the field is not 18 + # provided, it means no QMP capabilities will be enabled. 19 + # (since 2.12) 20 + # 21 + # Example: 22 + # 23 + # -> { "execute": "qmp_capabilities", 24 + # "arguments": { "enable": [ "oob" ] } } 25 + # <- { "return": {} } 26 + # 27 + # Notes: This command is valid exactly when first connecting: it must be 28 + # issued before any other command will be accepted, and will fail once the 29 + # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt) 30 + # 31 + # The QMP client needs to explicitly enable QMP capabilities, otherwise 32 + # all the QMP capabilities will be turned off by default. 33 + # 34 + # Since: 0.13 35 + # 36 + ## 37 + { 'command': 'qmp_capabilities', 38 + 'data': { '*enable': [ 'QMPCapability' ] }, 39 + 'allow-preconfig': true } 40 + 41 + ## 42 + # @QMPCapability: 43 + # 44 + # Enumeration of capabilities to be advertised during initial client 45 + # connection, used for agreeing on particular QMP extension behaviors. 46 + # 47 + # @oob: QMP ability to support out-of-band requests. 48 + # (Please refer to qmp-spec.txt for more information on OOB) 49 + # 50 + # Since: 2.12 51 + # 52 + ## 53 + { 'enum': 'QMPCapability', 54 + 'data': [ 'oob' ] } 55 + 56 + ## 57 + # @VersionTriple: 58 + # 59 + # A three-part version number. 60 + # 61 + # @major: The major version number. 62 + # 63 + # @minor: The minor version number. 64 + # 65 + # @micro: The micro version number. 66 + # 67 + # Since: 2.4 68 + ## 69 + { 'struct': 'VersionTriple', 70 + 'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} } 71 + 72 + 73 + ## 74 + # @VersionInfo: 75 + # 76 + # A description of QEMU's version. 77 + # 78 + # @qemu: The version of QEMU. By current convention, a micro 79 + # version of 50 signifies a development branch. A micro version 80 + # greater than or equal to 90 signifies a release candidate for 81 + # the next minor version. A micro version of less than 50 82 + # signifies a stable release. 83 + # 84 + # @package: QEMU will always set this field to an empty string. Downstream 85 + # versions of QEMU should set this to a non-empty string. The 86 + # exact format depends on the downstream however it highly 87 + # recommended that a unique name is used. 88 + # 89 + # Since: 0.14.0 90 + ## 91 + { 'struct': 'VersionInfo', 92 + 'data': {'qemu': 'VersionTriple', 'package': 'str'} } 93 + 94 + ## 95 + # @query-version: 96 + # 97 + # Returns the current version of QEMU. 98 + # 99 + # Returns: A @VersionInfo object describing the current version of QEMU. 100 + # 101 + # Since: 0.14.0 102 + # 103 + # Example: 104 + # 105 + # -> { "execute": "query-version" } 106 + # <- { 107 + # "return":{ 108 + # "qemu":{ 109 + # "major":0, 110 + # "minor":11, 111 + # "micro":5 112 + # }, 113 + # "package":"" 114 + # } 115 + # } 116 + # 117 + ## 118 + { 'command': 'query-version', 'returns': 'VersionInfo', 119 + 'allow-preconfig': true } 120 + 121 + ## 122 + # @CommandInfo: 123 + # 124 + # Information about a QMP command 125 + # 126 + # @name: The command name 127 + # 128 + # Since: 0.14.0 129 + ## 130 + { 'struct': 'CommandInfo', 'data': {'name': 'str'} } 131 + 132 + ## 133 + # @query-commands: 134 + # 135 + # Return a list of supported QMP commands by this server 136 + # 137 + # Returns: A list of @CommandInfo for all supported commands 138 + # 139 + # Since: 0.14.0 140 + # 141 + # Example: 142 + # 143 + # -> { "execute": "query-commands" } 144 + # <- { 145 + # "return":[ 146 + # { 147 + # "name":"query-balloon" 148 + # }, 149 + # { 150 + # "name":"system_powerdown" 151 + # } 152 + # ] 153 + # } 154 + # 155 + # Note: This example has been shortened as the real response is too long. 156 + # 157 + ## 158 + { 'command': 'query-commands', 'returns': ['CommandInfo'], 159 + 'allow-preconfig': true } 160 + 161 + ## 162 + # @EventInfo: 163 + # 164 + # Information about a QMP event 165 + # 166 + # @name: The event name 167 + # 168 + # Since: 1.2.0 169 + ## 170 + { 'struct': 'EventInfo', 'data': {'name': 'str'} } 171 + 172 + ## 173 + # @query-events: 174 + # 175 + # Return information on QMP events. 176 + # 177 + # Returns: A list of @EventInfo. 178 + # 179 + # Since: 1.2.0 180 + # 181 + # Note: This command is deprecated, because its output doesn't reflect 182 + # compile-time configuration. Use query-qmp-schema instead. 183 + # 184 + # Example: 185 + # 186 + # -> { "execute": "query-events" } 187 + # <- { 188 + # "return": [ 189 + # { 190 + # "name":"SHUTDOWN" 191 + # }, 192 + # { 193 + # "name":"RESET" 194 + # } 195 + # ] 196 + # } 197 + # 198 + # Note: This example has been shortened as the real response is too long. 199 + # 200 + ## 201 + { 'command': 'query-events', 'returns': ['EventInfo'] } 202 + 203 + ## 204 + # @quit: 205 + # 206 + # This command will cause the QEMU process to exit gracefully. While every 207 + # attempt is made to send the QMP response before terminating, this is not 208 + # guaranteed. When using this interface, a premature EOF would not be 209 + # unexpected. 210 + # 211 + # Since: 0.14.0 212 + # 213 + # Example: 214 + # 215 + # -> { "execute": "quit" } 216 + # <- { "return": {} } 217 + ## 218 + { 'command': 'quit' }
-212
qapi/misc.json
··· 8 8 { 'include': 'common.json' } 9 9 10 10 ## 11 - # @qmp_capabilities: 12 - # 13 - # Enable QMP capabilities. 14 - # 15 - # Arguments: 16 - # 17 - # @enable: An optional list of QMPCapability values to enable. The 18 - # client must not enable any capability that is not 19 - # mentioned in the QMP greeting message. If the field is not 20 - # provided, it means no QMP capabilities will be enabled. 21 - # (since 2.12) 22 - # 23 - # Example: 24 - # 25 - # -> { "execute": "qmp_capabilities", 26 - # "arguments": { "enable": [ "oob" ] } } 27 - # <- { "return": {} } 28 - # 29 - # Notes: This command is valid exactly when first connecting: it must be 30 - # issued before any other command will be accepted, and will fail once the 31 - # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt) 32 - # 33 - # The QMP client needs to explicitly enable QMP capabilities, otherwise 34 - # all the QMP capabilities will be turned off by default. 35 - # 36 - # Since: 0.13 37 - # 38 - ## 39 - { 'command': 'qmp_capabilities', 40 - 'data': { '*enable': [ 'QMPCapability' ] }, 41 - 'allow-preconfig': true } 42 - 43 - ## 44 - # @QMPCapability: 45 - # 46 - # Enumeration of capabilities to be advertised during initial client 47 - # connection, used for agreeing on particular QMP extension behaviors. 48 - # 49 - # @oob: QMP ability to support out-of-band requests. 50 - # (Please refer to qmp-spec.txt for more information on OOB) 51 - # 52 - # Since: 2.12 53 - # 54 - ## 55 - { 'enum': 'QMPCapability', 56 - 'data': [ 'oob' ] } 57 - 58 - ## 59 - # @VersionTriple: 60 - # 61 - # A three-part version number. 62 - # 63 - # @major: The major version number. 64 - # 65 - # @minor: The minor version number. 66 - # 67 - # @micro: The micro version number. 68 - # 69 - # Since: 2.4 70 - ## 71 - { 'struct': 'VersionTriple', 72 - 'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} } 73 - 74 - 75 - ## 76 - # @VersionInfo: 77 - # 78 - # A description of QEMU's version. 79 - # 80 - # @qemu: The version of QEMU. By current convention, a micro 81 - # version of 50 signifies a development branch. A micro version 82 - # greater than or equal to 90 signifies a release candidate for 83 - # the next minor version. A micro version of less than 50 84 - # signifies a stable release. 85 - # 86 - # @package: QEMU will always set this field to an empty string. Downstream 87 - # versions of QEMU should set this to a non-empty string. The 88 - # exact format depends on the downstream however it highly 89 - # recommended that a unique name is used. 90 - # 91 - # Since: 0.14.0 92 - ## 93 - { 'struct': 'VersionInfo', 94 - 'data': {'qemu': 'VersionTriple', 'package': 'str'} } 95 - 96 - ## 97 - # @query-version: 98 - # 99 - # Returns the current version of QEMU. 100 - # 101 - # Returns: A @VersionInfo object describing the current version of QEMU. 102 - # 103 - # Since: 0.14.0 104 - # 105 - # Example: 106 - # 107 - # -> { "execute": "query-version" } 108 - # <- { 109 - # "return":{ 110 - # "qemu":{ 111 - # "major":0, 112 - # "minor":11, 113 - # "micro":5 114 - # }, 115 - # "package":"" 116 - # } 117 - # } 118 - # 119 - ## 120 - { 'command': 'query-version', 'returns': 'VersionInfo', 121 - 'allow-preconfig': true } 122 - 123 - ## 124 - # @CommandInfo: 125 - # 126 - # Information about a QMP command 127 - # 128 - # @name: The command name 129 - # 130 - # Since: 0.14.0 131 - ## 132 - { 'struct': 'CommandInfo', 'data': {'name': 'str'} } 133 - 134 - ## 135 - # @query-commands: 136 - # 137 - # Return a list of supported QMP commands by this server 138 - # 139 - # Returns: A list of @CommandInfo for all supported commands 140 - # 141 - # Since: 0.14.0 142 - # 143 - # Example: 144 - # 145 - # -> { "execute": "query-commands" } 146 - # <- { 147 - # "return":[ 148 - # { 149 - # "name":"query-balloon" 150 - # }, 151 - # { 152 - # "name":"system_powerdown" 153 - # } 154 - # ] 155 - # } 156 - # 157 - # Note: This example has been shortened as the real response is too long. 158 - # 159 - ## 160 - { 'command': 'query-commands', 'returns': ['CommandInfo'], 161 - 'allow-preconfig': true } 162 - 163 - ## 164 11 # @LostTickPolicy: 165 12 # 166 13 # Policy for handling lost ticks in timer devices. Ticks end up getting ··· 311 158 # 312 159 ## 313 160 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true } 314 - 315 - ## 316 - # @EventInfo: 317 - # 318 - # Information about a QMP event 319 - # 320 - # @name: The event name 321 - # 322 - # Since: 1.2.0 323 - ## 324 - { 'struct': 'EventInfo', 'data': {'name': 'str'} } 325 - 326 - ## 327 - # @query-events: 328 - # 329 - # Return information on QMP events. 330 - # 331 - # Returns: A list of @EventInfo. 332 - # 333 - # Since: 1.2.0 334 - # 335 - # Note: This command is deprecated, because its output doesn't reflect 336 - # compile-time configuration. Use query-qmp-schema instead. 337 - # 338 - # Example: 339 - # 340 - # -> { "execute": "query-events" } 341 - # <- { 342 - # "return": [ 343 - # { 344 - # "name":"SHUTDOWN" 345 - # }, 346 - # { 347 - # "name":"RESET" 348 - # } 349 - # ] 350 - # } 351 - # 352 - # Note: This example has been shortened as the real response is too long. 353 - # 354 - ## 355 - { 'command': 'query-events', 'returns': ['EventInfo'] } 356 161 357 162 ## 358 163 # @IOThreadInfo: ··· 773 578 # 774 579 ## 775 580 { 'command': 'query-pci', 'returns': ['PciInfo'] } 776 - 777 - ## 778 - # @quit: 779 - # 780 - # This command will cause the QEMU process to exit gracefully. While every 781 - # attempt is made to send the QMP response before terminating, this is not 782 - # guaranteed. When using this interface, a premature EOF would not be 783 - # unexpected. 784 - # 785 - # Since: 0.14.0 786 - # 787 - # Example: 788 - # 789 - # -> { "execute": "quit" } 790 - # <- { "return": {} } 791 - ## 792 - { 'command': 'quit' } 793 581 794 582 ## 795 583 # @stop:
+1
qapi/qapi-schema.json
··· 98 98 { 'include': 'migration.json' } 99 99 { 'include': 'transaction.json' } 100 100 { 'include': 'trace.json' } 101 + { 'include': 'control.json' } 101 102 { 'include': 'introspect.json' } 102 103 { 'include': 'qom.json' } 103 104 { 'include': 'qdev.json' }
+1 -1
tests/qtest/qmp-test.c
··· 13 13 #include "qemu/osdep.h" 14 14 #include "libqtest.h" 15 15 #include "qapi/error.h" 16 - #include "qapi/qapi-visit-misc.h" 16 + #include "qapi/qapi-visit-control.h" 17 17 #include "qapi/qmp/qdict.h" 18 18 #include "qapi/qmp/qlist.h" 19 19 #include "qapi/qobject-input-visitor.h"
+1
ui/gtk.c
··· 32 32 33 33 #include "qemu/osdep.h" 34 34 #include "qapi/error.h" 35 + #include "qapi/qapi-commands-control.h" 35 36 #include "qapi/qapi-commands-misc.h" 36 37 #include "qemu/cutils.h" 37 38