1# -*- Mode: Python -*- 2# vim: filetype=python 3# 4 5## 6# *********** 7# Miscellanea 8# *********** 9## 10 11{ 'include': 'common.json' } 12 13## 14# @add_client: 15# 16# Allow client connections for VNC, Spice and socket based character 17# devices to be passed in to QEMU via SCM_RIGHTS. 18# 19# If the FD associated with @fdname is not a socket, the command will 20# fail and the FD will be closed. 21# 22# @protocol: protocol name. Valid names are "vnc", "spice", 23# "@dbus-display" or the name of a character device (e.g. from 24# -chardev id=XXXX) 25# 26# @fdname: file descriptor name previously passed via `getfd` command 27# 28# @skipauth: whether to skip authentication. Only applies to "vnc" 29# and "spice" protocols 30# 31# @tls: whether to perform TLS. Only applies to the "spice" protocol 32# 33# Since: 0.14 34# 35# .. qmp-example:: 36# 37# -> { "execute": "add_client", "arguments": { "protocol": "vnc", 38# "fdname": "myclient" } } 39# <- { "return": {} } 40## 41{ 'command': 'add_client', 42 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool', 43 '*tls': 'bool' } } 44 45## 46# @NameInfo: 47# 48# Guest name information. 49# 50# @name: The name of the guest 51# 52# Since: 0.14 53## 54{ 'struct': 'NameInfo', 'data': {'*name': 'str'} } 55 56## 57# @query-name: 58# 59# Return the name information of a guest. 60# 61# Since: 0.14 62# 63# .. qmp-example:: 64# 65# -> { "execute": "query-name" } 66# <- { "return": { "name": "qemu-name" } } 67## 68{ 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true } 69 70## 71# @IOThreadInfo: 72# 73# Information about an iothread 74# 75# @id: the identifier of the iothread 76# 77# @thread-id: ID of the underlying host thread 78# 79# @poll-max-ns: maximum polling time in ns, 0 means polling is 80# disabled (since 2.9) 81# 82# @poll-grow: how many ns will be added to polling time, 0 means that 83# it's not configured (since 2.9) 84# 85# @poll-shrink: how many ns will be removed from polling time, 0 means 86# that it's not configured (since 2.9) 87# 88# @aio-max-batch: maximum number of requests in a batch for the AIO 89# engine, 0 means that the engine will use its default (since 6.1) 90# 91# Since: 2.0 92## 93{ 'struct': 'IOThreadInfo', 94 'data': {'id': 'str', 95 'thread-id': 'int', 96 'poll-max-ns': 'int', 97 'poll-grow': 'int', 98 'poll-shrink': 'int', 99 'aio-max-batch': 'int' } } 100 101## 102# @query-iothreads: 103# 104# Return a list of information about each iothread. 105# 106# .. note:: This list excludes the QEMU main loop thread, which is not 107# declared using the ``-object iothread`` command-line option. It 108# is always the main thread of the process. 109# 110# Returns: a list of info for each iothread 111# 112# Since: 2.0 113# 114# .. qmp-example:: 115# 116# -> { "execute": "query-iothreads" } 117# <- { "return": [ 118# { 119# "id":"iothread0", 120# "thread-id":3134 121# }, 122# { 123# "id":"iothread1", 124# "thread-id":3135 125# } 126# ] 127# } 128## 129{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], 130 'allow-preconfig': true } 131 132## 133# @stop: 134# 135# Stop guest VM execution. 136# 137# Since: 0.14 138# 139# .. note:: This function will succeed even if the guest is already in 140# the stopped state. In "inmigrate" state, it will ensure that the 141# guest remains paused once migration finishes, as if the ``-S`` 142# option was passed on the command line. 143# 144# In the "suspended" state, it will completely stop the VM and 145# cause a transition to the "paused" state. (Since 9.0) 146# 147# .. qmp-example:: 148# 149# -> { "execute": "stop" } 150# <- { "return": {} } 151## 152{ 'command': 'stop' } 153 154## 155# @cont: 156# 157# Resume guest VM execution. 158# 159# Since: 0.14 160# 161# .. note:: This command will succeed if the guest is currently 162# running. It will also succeed if the guest is in the "inmigrate" 163# state; in this case, the effect of the command is to make sure 164# the guest starts once migration finishes, removing the effect of 165# the ``-S`` command line option if it was passed. 166# 167# If the VM was previously suspended, and not been reset or woken, 168# this command will transition back to the "suspended" state. 169# (Since 9.0) 170# 171# .. qmp-example:: 172# 173# -> { "execute": "cont" } 174# <- { "return": {} } 175## 176{ 'command': 'cont' } 177 178## 179# @x-exit-preconfig: 180# 181# Exit from "preconfig" state 182# 183# This command makes QEMU exit the preconfig state and proceed with VM 184# initialization using configuration data provided on the command line 185# and via the QMP monitor during the preconfig state. The command is 186# only available during the preconfig state (i.e. when the --preconfig 187# command line option was in use). 188# 189# Features: 190# 191# @unstable: This command is experimental. 192# 193# Since: 3.0 194# 195# .. qmp-example:: 196# 197# -> { "execute": "x-exit-preconfig" } 198# <- { "return": {} } 199## 200{ 'command': 'x-exit-preconfig', 'allow-preconfig': true, 201 'features': [ 'unstable' ] } 202 203## 204# @human-monitor-command: 205# 206# Execute a command on the human monitor and return the output. 207# 208# @command-line: the command to execute in the human monitor 209# 210# @cpu-index: The CPU to use for commands that require an implicit CPU 211# 212# Features: 213# 214# @savevm-monitor-nodes: If present, HMP command savevm only snapshots 215# monitor-owned nodes if they have no parents. This allows the 216# use of 'savevm' with -blockdev. (since 4.2) 217# 218# Returns: the output of the command as a string 219# 220# Since: 0.14 221# 222# .. note:: This command only exists as a stop-gap. Its use is highly 223# discouraged. The semantics of this command are not guaranteed: 224# this means that command names, arguments and responses can change 225# or be removed at **any** time. Applications that rely on long 226# term stability guarantees should **not** use this command. 227# 228# Known limitations: 229# 230# * This command is stateless, this means that commands that depend 231# on state information (such as `getfd`) might not work. 232# 233# * Commands that prompt the user for data don't currently work. 234# 235# .. qmp-example:: 236# 237# -> { "execute": "human-monitor-command", 238# "arguments": { "command-line": "info kvm" } } 239# <- { "return": "kvm support: enabled\r\n" } 240## 241{ 'command': 'human-monitor-command', 242 'data': {'command-line': 'str', '*cpu-index': 'int'}, 243 'returns': 'str', 244 'features': [ 'savevm-monitor-nodes' ] } 245 246## 247# @getfd: 248# 249# Receive a file descriptor via SCM rights and assign it a name 250# 251# @fdname: file descriptor name 252# 253# Since: 0.14 254# 255# .. note:: If @fdname already exists, the file descriptor assigned to 256# it will be closed and replaced by the received file descriptor. 257# 258# The `closefd` command can be used to explicitly close the file 259# descriptor when it is no longer needed. 260# 261# .. qmp-example:: 262# 263# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } } 264# <- { "return": {} } 265## 266{ 'command': 'getfd', 'data': {'fdname': 'str'}, 'if': 'CONFIG_POSIX' } 267 268## 269# @get-win32-socket: 270# 271# Add a socket that was duplicated to QEMU process with 272# WSADuplicateSocketW() via WSASocket() & WSAPROTOCOL_INFOW structure 273# and assign it a name (the SOCKET is associated with a CRT file 274# descriptor) 275# 276# @info: the WSAPROTOCOL_INFOW structure (encoded in base64) 277# 278# @fdname: file descriptor name 279# 280# Since: 8.0 281# 282# .. note:: If @fdname already exists, the file descriptor assigned to 283# it will be closed and replaced by the received file descriptor. 284# 285# The `closefd` command can be used to explicitly close the file 286# descriptor when it is no longer needed. 287# 288# .. qmp-example:: 289# 290# -> { "execute": "get-win32-socket", 291# "arguments": { "info": "abcd123..", "fdname": "skclient" } } 292# <- { "return": {} } 293## 294{ 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' } 295 296## 297# @closefd: 298# 299# Close a file descriptor previously passed via SCM rights 300# 301# @fdname: file descriptor name 302# 303# Since: 0.14 304# 305# .. qmp-example:: 306# 307# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } } 308# <- { "return": {} } 309## 310{ 'command': 'closefd', 'data': {'fdname': 'str'} } 311 312## 313# @AddfdInfo: 314# 315# Information about a file descriptor that was added to an fd set. 316# 317# @fdset-id: The ID of the fd set that @fd was added to. 318# 319# @fd: The file descriptor that was received via SCM rights and added 320# to the fd set. 321# 322# Since: 1.2 323## 324{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} } 325 326## 327# @add-fd: 328# 329# Add a file descriptor, that was passed via SCM rights, to an fd set. 330# 331# @fdset-id: The ID of the fd set to add the file descriptor to. 332# 333# @opaque: A free-form string that can be used to describe the fd. 334# 335# Errors: 336# - If file descriptor was not received, GenericError 337# - If @fdset-id is a negative value, GenericError 338# 339# .. note:: The list of fd sets is shared by all monitor connections. 340# 341# .. note:: If @fdset-id is not specified, a new fd set will be 342# created. 343# 344# Since: 1.2 345# 346# .. qmp-example:: 347# 348# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } } 349# <- { "return": { "fdset-id": 1, "fd": 3 } } 350## 351{ 'command': 'add-fd', 352 'data': { '*fdset-id': 'int', 353 '*opaque': 'str' }, 354 'returns': 'AddfdInfo' } 355 356## 357# @remove-fd: 358# 359# Remove a file descriptor from an fd set. 360# 361# @fdset-id: The ID of the fd set that the file descriptor belongs to. 362# 363# @fd: The file descriptor that is to be removed. 364# 365# Errors: 366# - If @fdset-id or @fd is not found, GenericError 367# 368# Since: 1.2 369# 370# .. note:: The list of fd sets is shared by all monitor connections. 371# 372# .. note:: If @fd is not specified, all file descriptors in @fdset-id 373# will be removed. 374# 375# .. qmp-example:: 376# 377# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } } 378# <- { "return": {} } 379## 380{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} } 381 382## 383# @FdsetFdInfo: 384# 385# Information about a file descriptor that belongs to an fd set. 386# 387# @fd: The file descriptor value. 388# 389# @opaque: A free-form string that can be used to describe the fd. 390# 391# Since: 1.2 392## 393{ 'struct': 'FdsetFdInfo', 394 'data': {'fd': 'int', '*opaque': 'str'} } 395 396## 397# @FdsetInfo: 398# 399# Information about an fd set. 400# 401# @fdset-id: The ID of the fd set. 402# 403# @fds: A list of file descriptors that belong to this fd set. 404# 405# Since: 1.2 406## 407{ 'struct': 'FdsetInfo', 408 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} } 409 410## 411# @query-fdsets: 412# 413# Return information describing all fd sets. 414# 415# Since: 1.2 416# 417# .. note:: The list of fd sets is shared by all monitor connections. 418# 419# .. qmp-example:: 420# 421# -> { "execute": "query-fdsets" } 422# <- { "return": [ 423# { 424# "fds": [ 425# { 426# "fd": 30, 427# "opaque": "rdonly:/path/to/file" 428# }, 429# { 430# "fd": 24, 431# "opaque": "rdwr:/path/to/file" 432# } 433# ], 434# "fdset-id": 1 435# }, 436# { 437# "fds": [ 438# { 439# "fd": 28 440# }, 441# { 442# "fd": 29 443# } 444# ], 445# "fdset-id": 0 446# } 447# ] 448# } 449## 450{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] } 451 452## 453# @CommandLineParameterType: 454# 455# Possible types for an option parameter. 456# 457# @string: accepts a character string 458# 459# @boolean: accepts "on" or "off" 460# 461# @number: accepts a number 462# 463# @size: accepts a number followed by an optional suffix (K)ilo, 464# (M)ega, (G)iga, (T)era 465# 466# Since: 1.5 467## 468{ 'enum': 'CommandLineParameterType', 469 'data': ['string', 'boolean', 'number', 'size'] } 470 471## 472# @CommandLineParameterInfo: 473# 474# Details about a single parameter of a command line option. 475# 476# @name: parameter name 477# 478# @type: parameter `CommandLineParameterType` 479# 480# @help: human readable text string, not suitable for parsing. 481# 482# @default: default value string (since 2.1) 483# 484# Since: 1.5 485## 486{ 'struct': 'CommandLineParameterInfo', 487 'data': { 'name': 'str', 488 'type': 'CommandLineParameterType', 489 '*help': 'str', 490 '*default': 'str' } } 491 492## 493# @CommandLineOptionInfo: 494# 495# Details about a command line option, including its list of parameter 496# details 497# 498# @option: option name 499# 500# @parameters: an array of `CommandLineParameterInfo` 501# 502# Since: 1.5 503## 504{ 'struct': 'CommandLineOptionInfo', 505 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } } 506 507## 508# @query-command-line-options: 509# 510# Query command line option schema. 511# 512# @option: option name 513# 514# Returns: list of objects for all options (or for the given @option). 515# 516# Errors: 517# - if the given @option doesn't exist 518# 519# Since: 1.5 520# 521# .. qmp-example:: 522# 523# -> { "execute": "query-command-line-options", 524# "arguments": { "option": "option-rom" } } 525# <- { "return": [ 526# { 527# "parameters": [ 528# { 529# "name": "romfile", 530# "type": "string" 531# }, 532# { 533# "name": "bootindex", 534# "type": "number" 535# } 536# ], 537# "option": "option-rom" 538# } 539# ] 540# } 541## 542{'command': 'query-command-line-options', 543 'data': {'*option': 'str'}, 544 'returns': ['CommandLineOptionInfo'], 545 'allow-preconfig': true} 546 547## 548# @RTC_CHANGE: 549# 550# Emitted when the guest changes the RTC time. 551# 552# @offset: offset in seconds between base RTC clock (as specified by 553# -rtc base), and new RTC clock value 554# 555# @qom-path: path to the RTC object in the QOM tree 556# 557# .. note:: This event is rate-limited. It is not guaranteed that the 558# RTC in the system implements this event, or even that the system 559# has an RTC at all. 560# 561# Since: 0.13 562# 563# .. qmp-example:: 564# 565# <- { "event": "RTC_CHANGE", 566# "data": { "offset": 78 }, 567# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } } 568## 569{ 'event': 'RTC_CHANGE', 570 'data': { 'offset': 'int', 'qom-path': 'str' } } 571 572## 573# @VFU_CLIENT_HANGUP: 574# 575# Emitted when the client of a TYPE_VFIO_USER_SERVER closes the 576# communication channel 577# 578# @vfu-id: ID of the TYPE_VFIO_USER_SERVER object. It is the last 579# component of @vfu-qom-path referenced below 580# 581# @vfu-qom-path: path to the TYPE_VFIO_USER_SERVER object in the QOM 582# tree 583# 584# @dev-id: ID of attached PCI device 585# 586# @dev-qom-path: path to attached PCI device in the QOM tree 587# 588# Since: 7.1 589# 590# .. qmp-example:: 591# 592# <- { "event": "VFU_CLIENT_HANGUP", 593# "data": { "vfu-id": "vfu1", 594# "vfu-qom-path": "/objects/vfu1", 595# "dev-id": "sas1", 596# "dev-qom-path": "/machine/peripheral/sas1" }, 597# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } 598## 599{ 'event': 'VFU_CLIENT_HANGUP', 600 'data': { 'vfu-id': 'str', 'vfu-qom-path': 'str', 601 'dev-id': 'str', 'dev-qom-path': 'str' } } 602