qapi: Reformat doc comments to conform to current conventions
[qemu/kevin.git] / qapi / ui.json
blobd51e34049cf30e205636c78911be5ef55a469812
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = Remote desktop
7 ##
9 { 'include': 'common.json' }
10 { 'include': 'sockets.json' }
13 # @DisplayProtocol:
15 # Display protocols which support changing password options.
17 # Since: 7.0
19 { 'enum': 'DisplayProtocol',
20   'data': [ 'vnc', 'spice' ] }
23 # @SetPasswordAction:
25 # An action to take on changing a password on a connection with active
26 # clients.
28 # @keep: maintain existing clients
30 # @fail: fail the command if clients are connected
32 # @disconnect: disconnect existing clients
34 # Since: 7.0
36 { 'enum': 'SetPasswordAction',
37   'data': [ 'keep', 'fail', 'disconnect' ] }
40 # @SetPasswordOptions:
42 # Options for set_password.
44 # @protocol:
45 #     - 'vnc' to modify the VNC server password
46 #     - 'spice' to modify the Spice server password
48 # @password: the new password
50 # @connected: How to handle existing clients when changing the
51 #     password.  If nothing is specified, defaults to 'keep'. For VNC,
52 #     only 'keep' is currently implemented.
54 # Since: 7.0
56 { 'union': 'SetPasswordOptions',
57   'base': { 'protocol': 'DisplayProtocol',
58             'password': 'str',
59             '*connected': 'SetPasswordAction' },
60   'discriminator': 'protocol',
61   'data': { 'vnc': 'SetPasswordOptionsVnc' } }
64 # @SetPasswordOptionsVnc:
66 # Options for set_password specific to the VNC procotol.
68 # @display: The id of the display where the password should be
69 #     changed.  Defaults to the first.
71 # Since: 7.0
73 { 'struct': 'SetPasswordOptionsVnc',
74   'data': { '*display': 'str' } }
77 # @set_password:
79 # Set the password of a remote display server.
81 # Returns:
82 #     - Nothing on success
83 #     - If Spice is not enabled, DeviceNotFound
85 # Since: 0.14
87 # Example:
89 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
90 #                                                "password": "secret" } }
91 # <- { "return": {} }
93 { 'command': 'set_password', 'boxed': true, 'data': 'SetPasswordOptions' }
96 # @ExpirePasswordOptions:
98 # General options for expire_password.
100 # @protocol:
101 #     - 'vnc' to modify the VNC server expiration
102 #     - 'spice' to modify the Spice server expiration
104 # @time: when to expire the password.
106 #     - 'now' to expire the password immediately
107 #     - 'never' to cancel password expiration
108 #     - '+INT' where INT is the number of seconds from now (integer)
109 #     - 'INT' where INT is the absolute time in seconds
111 # Notes: Time is relative to the server and currently there is no way
112 #     to coordinate server time with client time.  It is not
113 #     recommended to use the absolute time version of the @time
114 #     parameter unless you're sure you are on the same machine as the
115 #     QEMU instance.
117 # Since: 7.0
119 { 'union': 'ExpirePasswordOptions',
120   'base': { 'protocol': 'DisplayProtocol',
121             'time': 'str' },
122   'discriminator': 'protocol',
123   'data': { 'vnc': 'ExpirePasswordOptionsVnc' } }
126 # @ExpirePasswordOptionsVnc:
128 # Options for expire_password specific to the VNC procotol.
130 # @display: The id of the display where the expiration should be
131 #     changed.  Defaults to the first.
133 # Since: 7.0
135 { 'struct': 'ExpirePasswordOptionsVnc',
136   'data': { '*display': 'str' } }
139 # @expire_password:
141 # Expire the password of a remote display server.
143 # Returns:
144 #     - Nothing on success
145 #     - If @protocol is 'spice' and Spice is not active,
146 #       DeviceNotFound
148 # Since: 0.14
150 # Example:
152 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
153 #                                                   "time": "+60" } }
154 # <- { "return": {} }
156 { 'command': 'expire_password', 'boxed': true, 'data': 'ExpirePasswordOptions' }
159 # @ImageFormat:
161 # Supported image format types.
163 # @png: PNG format
165 # @ppm: PPM format
167 # Since: 7.1
169 { 'enum': 'ImageFormat',
170   'data': ['ppm', 'png'] }
173 # @screendump:
175 # Capture the contents of a screen and write it to a file.
177 # @filename: the path of a new file to store the image
179 # @device: ID of the display device that should be dumped.  If this
180 #     parameter is missing, the primary display will be used.  (Since
181 #     2.12)
183 # @head: head to use in case the device supports multiple heads.  If
184 #     this parameter is missing, head #0 will be used.  Also note that
185 #     the head can only be specified in conjunction with the device
186 #     ID. (Since 2.12)
188 # @format: image format for screendump.  (default: ppm) (Since 7.1)
190 # Returns: Nothing on success
192 # Since: 0.14
194 # Example:
196 # -> { "execute": "screendump",
197 #      "arguments": { "filename": "/tmp/image" } }
198 # <- { "return": {} }
200 { 'command': 'screendump',
201   'data': {'filename': 'str', '*device': 'str', '*head': 'int',
202            '*format': 'ImageFormat'},
203   'coroutine': true }
206 # == Spice
210 # @SpiceBasicInfo:
212 # The basic information for SPICE network connection
214 # @host: IP address
216 # @port: port number
218 # @family: address family
220 # Since: 2.1
222 { 'struct': 'SpiceBasicInfo',
223   'data': { 'host': 'str',
224             'port': 'str',
225             'family': 'NetworkAddressFamily' },
226   'if': 'CONFIG_SPICE' }
229 # @SpiceServerInfo:
231 # Information about a SPICE server
233 # @auth: authentication method
235 # Since: 2.1
237 { 'struct': 'SpiceServerInfo',
238   'base': 'SpiceBasicInfo',
239   'data': { '*auth': 'str' },
240   'if': 'CONFIG_SPICE' }
243 # @SpiceChannel:
245 # Information about a SPICE client channel.
247 # @connection-id: SPICE connection id number.  All channels with the
248 #     same id belong to the same SPICE session.
250 # @channel-type: SPICE channel type number.  "1" is the main control
251 #     channel, filter for this one if you want to track spice sessions
252 #     only
254 # @channel-id: SPICE channel ID number.  Usually "0", might be
255 #     different when multiple channels of the same type exist, such as
256 #     multiple display channels in a multihead setup
258 # @tls: true if the channel is encrypted, false otherwise.
260 # Since: 0.14
262 { 'struct': 'SpiceChannel',
263   'base': 'SpiceBasicInfo',
264   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
265            'tls': 'bool'},
266   'if': 'CONFIG_SPICE' }
269 # @SpiceQueryMouseMode:
271 # An enumeration of Spice mouse states.
273 # @client: Mouse cursor position is determined by the client.
275 # @server: Mouse cursor position is determined by the server.
277 # @unknown: No information is available about mouse mode used by the
278 #     spice server.
280 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
282 # Since: 1.1
284 { 'enum': 'SpiceQueryMouseMode',
285   'data': [ 'client', 'server', 'unknown' ],
286   'if': 'CONFIG_SPICE' }
289 # @SpiceInfo:
291 # Information about the SPICE session.
293 # @enabled: true if the SPICE server is enabled, false otherwise
295 # @migrated: true if the last guest migration completed and spice
296 #     migration had completed as well.  false otherwise.  (since 1.4)
298 # @host: The hostname the SPICE server is bound to.  This depends on
299 #     the name resolution on the host and may be an IP address.
301 # @port: The SPICE server's port number.
303 # @compiled-version: SPICE server version.
305 # @tls-port: The SPICE server's TLS port number.
307 # @auth: the current authentication type used by the server
309 #     - 'none'  if no authentication is being used
310 #     - 'spice' uses SASL or direct TLS authentication, depending on
311 #       command line options
313 # @mouse-mode: The mode in which the mouse cursor is displayed
314 #     currently.  Can be determined by the client or the server, or
315 #     unknown if spice server doesn't provide this information.
316 #     (since: 1.1)
318 # @channels: a list of @SpiceChannel for each active spice channel
320 # Since: 0.14
322 { 'struct': 'SpiceInfo',
323   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
324            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
325            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']},
326   'if': 'CONFIG_SPICE' }
329 # @query-spice:
331 # Returns information about the current SPICE server
333 # Returns: @SpiceInfo
335 # Since: 0.14
337 # Example:
339 # -> { "execute": "query-spice" }
340 # <- { "return": {
341 #          "enabled": true,
342 #          "auth": "spice",
343 #          "port": 5920,
344 #          "migrated":false,
345 #          "tls-port": 5921,
346 #          "host": "0.0.0.0",
347 #          "mouse-mode":"client",
348 #          "channels": [
349 #             {
350 #                "port": "54924",
351 #                "family": "ipv4",
352 #                "channel-type": 1,
353 #                "connection-id": 1804289383,
354 #                "host": "127.0.0.1",
355 #                "channel-id": 0,
356 #                "tls": true
357 #             },
358 #             {
359 #                "port": "36710",
360 #                "family": "ipv4",
361 #                "channel-type": 4,
362 #                "connection-id": 1804289383,
363 #                "host": "127.0.0.1",
364 #                "channel-id": 0,
365 #                "tls": false
366 #             },
367 #             [ ... more channels follow ... ]
368 #          ]
369 #       }
370 #    }
372 { 'command': 'query-spice', 'returns': 'SpiceInfo',
373   'if': 'CONFIG_SPICE' }
376 # @SPICE_CONNECTED:
378 # Emitted when a SPICE client establishes a connection
380 # @server: server information
382 # @client: client information
384 # Since: 0.14
386 # Example:
388 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
389 #      "event": "SPICE_CONNECTED",
390 #      "data": {
391 #        "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
392 #        "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
393 #    }}
395 { 'event': 'SPICE_CONNECTED',
396   'data': { 'server': 'SpiceBasicInfo',
397             'client': 'SpiceBasicInfo' },
398   'if': 'CONFIG_SPICE' }
401 # @SPICE_INITIALIZED:
403 # Emitted after initial handshake and authentication takes place (if
404 # any) and the SPICE channel is up and running
406 # @server: server information
408 # @client: client information
410 # Since: 0.14
412 # Example:
414 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
415 #      "event": "SPICE_INITIALIZED",
416 #      "data": {"server": {"auth": "spice", "port": "5921",
417 #                          "family": "ipv4", "host": "127.0.0.1"},
418 #               "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
419 #                          "connection-id": 1804289383, "host": "127.0.0.1",
420 #                          "channel-id": 0, "tls": true}
421 #    }}
423 { 'event': 'SPICE_INITIALIZED',
424   'data': { 'server': 'SpiceServerInfo',
425             'client': 'SpiceChannel' },
426   'if': 'CONFIG_SPICE' }
429 # @SPICE_DISCONNECTED:
431 # Emitted when the SPICE connection is closed
433 # @server: server information
435 # @client: client information
437 # Since: 0.14
439 # Example:
441 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
442 #      "event": "SPICE_DISCONNECTED",
443 #      "data": {
444 #        "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
445 #        "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
446 #    }}
448 { 'event': 'SPICE_DISCONNECTED',
449   'data': { 'server': 'SpiceBasicInfo',
450             'client': 'SpiceBasicInfo' },
451   'if': 'CONFIG_SPICE' }
454 # @SPICE_MIGRATE_COMPLETED:
456 # Emitted when SPICE migration has completed
458 # Since: 1.3
460 # Example:
462 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
463 #      "event": "SPICE_MIGRATE_COMPLETED" }
465 { 'event': 'SPICE_MIGRATE_COMPLETED',
466   'if': 'CONFIG_SPICE' }
469 # == VNC
473 # @VncBasicInfo:
475 # The basic information for vnc network connection
477 # @host: IP address
479 # @service: The service name of the vnc port.  This may depend on the
480 #     host system's service database so symbolic names should not be
481 #     relied on.
483 # @family: address family
485 # @websocket: true in case the socket is a websocket (since 2.3).
487 # Since: 2.1
489 { 'struct': 'VncBasicInfo',
490   'data': { 'host': 'str',
491             'service': 'str',
492             'family': 'NetworkAddressFamily',
493             'websocket': 'bool' },
494   'if': 'CONFIG_VNC' }
497 # @VncServerInfo:
499 # The network connection information for server
501 # @auth: authentication method used for the plain (non-websocket) VNC
502 #     server
504 # Since: 2.1
506 { 'struct': 'VncServerInfo',
507   'base': 'VncBasicInfo',
508   'data': { '*auth': 'str' },
509   'if': 'CONFIG_VNC' }
512 # @VncClientInfo:
514 # Information about a connected VNC client.
516 # @x509_dname: If x509 authentication is in use, the Distinguished
517 #     Name of the client.
519 # @sasl_username: If SASL authentication is in use, the SASL username
520 #     used for authentication.
522 # Since: 0.14
524 { 'struct': 'VncClientInfo',
525   'base': 'VncBasicInfo',
526   'data': { '*x509_dname': 'str', '*sasl_username': 'str' },
527   'if': 'CONFIG_VNC' }
530 # @VncInfo:
532 # Information about the VNC session.
534 # @enabled: true if the VNC server is enabled, false otherwise
536 # @host: The hostname the VNC server is bound to.  This depends on the
537 #     name resolution on the host and may be an IP address.
539 # @family:
540 #     - 'ipv6' if the host is listening for IPv6 connections
541 #     - 'ipv4' if the host is listening for IPv4 connections
542 #     - 'unix' if the host is listening on a unix domain socket
543 #     - 'unknown' otherwise
545 # @service: The service name of the server's port.  This may depends
546 #     on the host system's service database so symbolic names should
547 #     not be relied on.
549 # @auth: the current authentication type used by the server
551 #     - 'none' if no authentication is being used
552 #     - 'vnc' if VNC authentication is being used
553 #     - 'vencrypt+plain' if VEncrypt is used with plain text
554 #       authentication
555 #     - 'vencrypt+tls+none' if VEncrypt is used with TLS and no
556 #       authentication
557 #     - 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC
558 #       authentication
559 #     - 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain
560 #       text auth
561 #     - 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
562 #     - 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
563 #     - 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain
564 #       text auth
565 #     - 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
566 #     - 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL
567 #       auth
569 # @clients: a list of @VncClientInfo of all currently connected
570 #     clients
572 # Since: 0.14
574 { 'struct': 'VncInfo',
575   'data': {'enabled': 'bool', '*host': 'str',
576            '*family': 'NetworkAddressFamily',
577            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']},
578   'if': 'CONFIG_VNC' }
581 # @VncPrimaryAuth:
583 # vnc primary authentication method.
585 # Since: 2.3
587 { 'enum': 'VncPrimaryAuth',
588   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
589             'tls', 'vencrypt', 'sasl' ],
590   'if': 'CONFIG_VNC' }
593 # @VncVencryptSubAuth:
595 # vnc sub authentication method with vencrypt.
597 # Since: 2.3
599 { 'enum': 'VncVencryptSubAuth',
600   'data': [ 'plain',
601             'tls-none',  'x509-none',
602             'tls-vnc',   'x509-vnc',
603             'tls-plain', 'x509-plain',
604             'tls-sasl',  'x509-sasl' ],
605   'if': 'CONFIG_VNC' }
608 # @VncServerInfo2:
610 # The network connection information for server
612 # @auth: The current authentication type used by the servers
614 # @vencrypt: The vencrypt sub authentication type used by the servers,
615 #     only specified in case auth == vencrypt.
617 # Since: 2.9
619 { 'struct': 'VncServerInfo2',
620   'base': 'VncBasicInfo',
621   'data': { 'auth'      : 'VncPrimaryAuth',
622             '*vencrypt' : 'VncVencryptSubAuth' },
623   'if': 'CONFIG_VNC' }
626 # @VncInfo2:
628 # Information about a vnc server
630 # @id: vnc server name.
632 # @server: A list of @VncBasincInfo describing all listening sockets.
633 #     The list can be empty (in case the vnc server is disabled). It
634 #     also may have multiple entries: normal + websocket, possibly
635 #     also ipv4 + ipv6 in the future.
637 # @clients: A list of @VncClientInfo of all currently connected
638 #     clients.  The list can be empty, for obvious reasons.
640 # @auth: The current authentication type used by the non-websockets
641 #     servers
643 # @vencrypt: The vencrypt authentication type used by the servers,
644 #     only specified in case auth == vencrypt.
646 # @display: The display device the vnc server is linked to.
648 # Since: 2.3
650 { 'struct': 'VncInfo2',
651   'data': { 'id'        : 'str',
652             'server'    : ['VncServerInfo2'],
653             'clients'   : ['VncClientInfo'],
654             'auth'      : 'VncPrimaryAuth',
655             '*vencrypt' : 'VncVencryptSubAuth',
656             '*display'  : 'str' },
657   'if': 'CONFIG_VNC' }
660 # @query-vnc:
662 # Returns information about the current VNC server
664 # Returns: @VncInfo
666 # Since: 0.14
668 # Example:
670 # -> { "execute": "query-vnc" }
671 # <- { "return": {
672 #          "enabled":true,
673 #          "host":"0.0.0.0",
674 #          "service":"50402",
675 #          "auth":"vnc",
676 #          "family":"ipv4",
677 #          "clients":[
678 #             {
679 #                "host":"127.0.0.1",
680 #                "service":"50401",
681 #                "family":"ipv4",
682 #                "websocket":false
683 #             }
684 #          ]
685 #       }
686 #    }
688 { 'command': 'query-vnc', 'returns': 'VncInfo',
689   'if': 'CONFIG_VNC' }
691 # @query-vnc-servers:
693 # Returns a list of vnc servers.  The list can be empty.
695 # Returns: a list of @VncInfo2
697 # Since: 2.3
699 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'],
700   'if': 'CONFIG_VNC' }
703 # @change-vnc-password:
705 # Change the VNC server password.
707 # @password: the new password to use with VNC authentication
709 # Since: 1.1
711 # Notes: An empty password in this command will set the password to
712 #     the empty string.  Existing clients are unaffected by executing
713 #     this command.
715 { 'command': 'change-vnc-password',
716   'data': { 'password': 'str' },
717   'if': 'CONFIG_VNC' }
720 # @VNC_CONNECTED:
722 # Emitted when a VNC client establishes a connection
724 # @server: server information
726 # @client: client information
728 # Note: This event is emitted before any authentication takes place,
729 #     thus the authentication ID is not provided
731 # Since: 0.13
733 # Example:
735 # <- { "event": "VNC_CONNECTED",
736 #      "data": {
737 #            "server": { "auth": "sasl", "family": "ipv4", "websocket": false,
738 #                        "service": "5901", "host": "0.0.0.0" },
739 #            "client": { "family": "ipv4", "service": "58425",
740 #                        "host": "127.0.0.1", "websocket": false } },
741 #      "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
743 { 'event': 'VNC_CONNECTED',
744   'data': { 'server': 'VncServerInfo',
745             'client': 'VncBasicInfo' },
746   'if': 'CONFIG_VNC' }
749 # @VNC_INITIALIZED:
751 # Emitted after authentication takes place (if any) and the VNC
752 # session is made active
754 # @server: server information
756 # @client: client information
758 # Since: 0.13
760 # Example:
762 # <-  { "event": "VNC_INITIALIZED",
763 #       "data": {
764 #            "server": { "auth": "sasl", "family": "ipv4", "websocket": false,
765 #                        "service": "5901", "host": "0.0.0.0"},
766 #            "client": { "family": "ipv4", "service": "46089", "websocket": false,
767 #                        "host": "127.0.0.1", "sasl_username": "luiz" } },
768 #       "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
770 { 'event': 'VNC_INITIALIZED',
771   'data': { 'server': 'VncServerInfo',
772             'client': 'VncClientInfo' },
773   'if': 'CONFIG_VNC' }
776 # @VNC_DISCONNECTED:
778 # Emitted when the connection is closed
780 # @server: server information
782 # @client: client information
784 # Since: 0.13
786 # Example:
788 # <- { "event": "VNC_DISCONNECTED",
789 #      "data": {
790 #            "server": { "auth": "sasl", "family": "ipv4", "websocket": false,
791 #                        "service": "5901", "host": "0.0.0.0" },
792 #            "client": { "family": "ipv4", "service": "58425", "websocket": false,
793 #                        "host": "127.0.0.1", "sasl_username": "luiz" } },
794 #      "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
796 { 'event': 'VNC_DISCONNECTED',
797   'data': { 'server': 'VncServerInfo',
798             'client': 'VncClientInfo' },
799   'if': 'CONFIG_VNC' }
802 # = Input
806 # @MouseInfo:
808 # Information about a mouse device.
810 # @name: the name of the mouse device
812 # @index: the index of the mouse device
814 # @current: true if this device is currently receiving mouse events
816 # @absolute: true if this device supports absolute coordinates as
817 #     input
819 # Since: 0.14
821 { 'struct': 'MouseInfo',
822   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
823            'absolute': 'bool'} }
826 # @query-mice:
828 # Returns information about each active mouse device
830 # Returns: a list of @MouseInfo for each device
832 # Since: 0.14
834 # Example:
836 # -> { "execute": "query-mice" }
837 # <- { "return": [
838 #          {
839 #             "name":"QEMU Microsoft Mouse",
840 #             "index":0,
841 #             "current":false,
842 #             "absolute":false
843 #          },
844 #          {
845 #             "name":"QEMU PS/2 Mouse",
846 #             "index":1,
847 #             "current":true,
848 #             "absolute":true
849 #          }
850 #       ]
851 #    }
853 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
856 # @QKeyCode:
858 # An enumeration of key name.
860 # This is used by the @send-key command.
862 # @unmapped: since 2.0
864 # @pause: since 2.0
866 # @ro: since 2.4
868 # @kp_comma: since 2.4
870 # @kp_equals: since 2.6
872 # @power: since 2.6
874 # @hiragana: since 2.9
876 # @henkan: since 2.9
878 # @yen: since 2.9
880 # @sleep: since 2.10
882 # @wake: since 2.10
884 # @audionext: since 2.10
886 # @audioprev: since 2.10
888 # @audiostop: since 2.10
890 # @audioplay: since 2.10
892 # @audiomute: since 2.10
894 # @volumeup: since 2.10
896 # @volumedown: since 2.10
898 # @mediaselect: since 2.10
900 # @mail: since 2.10
902 # @calculator: since 2.10
904 # @computer: since 2.10
906 # @ac_home: since 2.10
908 # @ac_back: since 2.10
910 # @ac_forward: since 2.10
912 # @ac_refresh: since 2.10
914 # @ac_bookmarks: since 2.10
916 # @muhenkan: since 2.12
918 # @katakanahiragana: since 2.12
920 # @lang1: since 6.1
922 # @lang2: since 6.1
924 # @f13: since 8.0
926 # @f14: since 8.0
928 # @f15: since 8.0
930 # @f16: since 8.0
932 # @f17: since 8.0
934 # @f18: since 8.0
936 # @f19: since 8.0
938 # @f20: since 8.0
940 # @f21: since 8.0
942 # @f22: since 8.0
944 # @f23: since 8.0
946 # @f24: since 8.0
948 # 'sysrq' was mistakenly added to hack around the fact that the ps2
949 # driver was not generating correct scancodes sequences when
950 # 'alt+print' was pressed.  This flaw is now fixed and the 'sysrq' key
951 # serves no further purpose.  Any further use of 'sysrq' will be
952 # transparently changed to 'print', so they are effectively synonyms.
954 # Since: 1.3
956 { 'enum': 'QKeyCode',
957   'data': [ 'unmapped',
958             'shift', 'shift_r', 'alt', 'alt_r', 'ctrl',
959             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
960             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
961             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
962             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
963             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
964             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
965             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
966             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
967             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
968             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
969             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
970             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
971             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
972             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
973             'ro', 'hiragana', 'henkan', 'yen', 'muhenkan', 'katakanahiragana',
974             'kp_comma', 'kp_equals', 'power', 'sleep', 'wake',
975             'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
976             'volumeup', 'volumedown', 'mediaselect',
977             'mail', 'calculator', 'computer',
978             'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks',
979             'lang1', 'lang2','f13','f14','f15','f16','f17','f18','f19','f20','f21','f22','f23','f24' ] }
982 # @KeyValueKind:
984 # Since: 1.3
986 { 'enum': 'KeyValueKind',
987   'data': [ 'number', 'qcode' ] }
990 # @IntWrapper:
992 # Since: 1.3
994 { 'struct': 'IntWrapper',
995   'data': { 'data': 'int' } }
998 # @QKeyCodeWrapper:
1000 # Since: 1.3
1002 { 'struct': 'QKeyCodeWrapper',
1003   'data': { 'data': 'QKeyCode' } }
1006 # @KeyValue:
1008 # Represents a keyboard key.
1010 # Since: 1.3
1012 { 'union': 'KeyValue',
1013   'base': { 'type': 'KeyValueKind' },
1014   'discriminator': 'type',
1015   'data': {
1016     'number': 'IntWrapper',
1017     'qcode': 'QKeyCodeWrapper' } }
1020 # @send-key:
1022 # Send keys to guest.
1024 # @keys: An array of @KeyValue elements.  All @KeyValues in this array
1025 #     are simultaneously sent to the guest.  A @KeyValue.number value
1026 #     is sent directly to the guest, while @KeyValue.qcode must be a
1027 #     valid @QKeyCode value
1029 # @hold-time: time to delay key up events, milliseconds.  Defaults to
1030 #     100
1032 # Returns:
1033 #     - Nothing on success
1034 #     - If key is unknown or redundant, GenericError
1036 # Since: 1.3
1038 # Example:
1040 # -> { "execute": "send-key",
1041 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
1042 #                               { "type": "qcode", "data": "alt" },
1043 #                               { "type": "qcode", "data": "delete" } ] } }
1044 # <- { "return": {} }
1046 { 'command': 'send-key',
1047   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
1050 # @InputButton:
1052 # Button of a pointer input device (mouse, tablet).
1054 # @side: front side button of a 5-button mouse (since 2.9)
1056 # @extra: rear side button of a 5-button mouse (since 2.9)
1058 # Since: 2.0
1060 { 'enum'  : 'InputButton',
1061   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
1062   'extra', 'wheel-left', 'wheel-right' ] }
1065 # @InputAxis:
1067 # Position axis of a pointer input device (mouse, tablet).
1069 # Since: 2.0
1071 { 'enum'  : 'InputAxis',
1072   'data'  : [ 'x', 'y' ] }
1075 # @InputKeyEvent:
1077 # Keyboard input event.
1079 # @key: Which key this event is for.
1081 # @down: True for key-down and false for key-up events.
1083 # Since: 2.0
1085 { 'struct'  : 'InputKeyEvent',
1086   'data'  : { 'key'     : 'KeyValue',
1087               'down'    : 'bool' } }
1090 # @InputBtnEvent:
1092 # Pointer button input event.
1094 # @button: Which button this event is for.
1096 # @down: True for key-down and false for key-up events.
1098 # Since: 2.0
1100 { 'struct'  : 'InputBtnEvent',
1101   'data'  : { 'button'  : 'InputButton',
1102               'down'    : 'bool' } }
1105 # @InputMoveEvent:
1107 # Pointer motion input event.
1109 # @axis: Which axis is referenced by @value.
1111 # @value: Pointer position.  For absolute coordinates the valid range
1112 #     is 0 -> 0x7ffff
1114 # Since: 2.0
1116 { 'struct'  : 'InputMoveEvent',
1117   'data'  : { 'axis'    : 'InputAxis',
1118               'value'   : 'int' } }
1121 # @InputEventKind:
1123 # Since: 2.0
1125 { 'enum': 'InputEventKind',
1126   'data': [ 'key', 'btn', 'rel', 'abs' ] }
1129 # @InputKeyEventWrapper:
1131 # Since: 2.0
1133 { 'struct': 'InputKeyEventWrapper',
1134   'data': { 'data': 'InputKeyEvent' } }
1137 # @InputBtnEventWrapper:
1139 # Since: 2.0
1141 { 'struct': 'InputBtnEventWrapper',
1142   'data': { 'data': 'InputBtnEvent' } }
1145 # @InputMoveEventWrapper:
1147 # Since: 2.0
1149 { 'struct': 'InputMoveEventWrapper',
1150   'data': { 'data': 'InputMoveEvent' } }
1153 # @InputEvent:
1155 # Input event union.
1157 # @type: the input type, one of:
1159 #     - 'key': Input event of Keyboard
1160 #     - 'btn': Input event of pointer buttons
1161 #     - 'rel': Input event of relative pointer motion
1162 #     - 'abs': Input event of absolute pointer motion
1164 # Since: 2.0
1166 { 'union' : 'InputEvent',
1167   'base': { 'type': 'InputEventKind' },
1168   'discriminator': 'type',
1169   'data'  : { 'key'     : 'InputKeyEventWrapper',
1170               'btn'     : 'InputBtnEventWrapper',
1171               'rel'     : 'InputMoveEventWrapper',
1172               'abs'     : 'InputMoveEventWrapper' } }
1175 # @input-send-event:
1177 # Send input event(s) to guest.
1179 # The @device and @head parameters can be used to send the input event
1180 # to specific input devices in case (a) multiple input devices of the
1181 # same kind are added to the virtual machine and (b) you have
1182 # configured input routing (see docs/multiseat.txt) for those input
1183 # devices.  The parameters work exactly like the device and head
1184 # properties of input devices.  If @device is missing, only devices
1185 # that have no input routing config are admissible.  If @device is
1186 # specified, both input devices with and without input routing config
1187 # are admissible, but devices with input routing config take
1188 # precedence.
1190 # @device: display device to send event(s) to.
1192 # @head: head to send event(s) to, in case the display device supports
1193 #     multiple scanouts.
1195 # @events: List of InputEvent union.
1197 # Returns: Nothing on success.
1199 # Since: 2.6
1201 # Note: The consoles are visible in the qom tree, under
1202 #     /backend/console[$index]. They have a device link and head
1203 #     property, so it is possible to map which console belongs to
1204 #     which device and display.
1206 # Examples:
1208 # 1. Press left mouse button.
1210 # -> { "execute": "input-send-event",
1211 #     "arguments": { "device": "video0",
1212 #                    "events": [ { "type": "btn",
1213 #                    "data" : { "down": true, "button": "left" } } ] } }
1214 # <- { "return": {} }
1216 # -> { "execute": "input-send-event",
1217 #     "arguments": { "device": "video0",
1218 #                    "events": [ { "type": "btn",
1219 #                    "data" : { "down": false, "button": "left" } } ] } }
1220 # <- { "return": {} }
1222 # 2. Press ctrl-alt-del.
1224 # -> { "execute": "input-send-event",
1225 #      "arguments": { "events": [
1226 #         { "type": "key", "data" : { "down": true,
1227 #           "key": {"type": "qcode", "data": "ctrl" } } },
1228 #         { "type": "key", "data" : { "down": true,
1229 #           "key": {"type": "qcode", "data": "alt" } } },
1230 #         { "type": "key", "data" : { "down": true,
1231 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
1232 # <- { "return": {} }
1234 # 3. Move mouse pointer to absolute coordinates (20000, 400).
1236 # -> { "execute": "input-send-event" ,
1237 #   "arguments": { "events": [
1238 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
1239 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
1240 # <- { "return": {} }
1242 { 'command': 'input-send-event',
1243   'data': { '*device': 'str',
1244             '*head'  : 'int',
1245             'events' : [ 'InputEvent' ] } }
1248 # @DisplayGTK:
1250 # GTK display options.
1252 # @grab-on-hover: Grab keyboard input on mouse hover.
1254 # @zoom-to-fit: Zoom guest display to fit into the host window.  When
1255 #     turned off the host window will be resized instead.  In case the
1256 #     display device can notify the guest on window resizes
1257 #     (virtio-gpu) this will default to "on", assuming the guest will
1258 #     resize the display to match the window size then.  Otherwise it
1259 #     defaults to "off". (Since 3.1)
1261 # @show-tabs: Display the tab bar for switching between the various
1262 #     graphical interfaces (e.g.  VGA and virtual console character
1263 #     devices) by default.  (Since 7.1)
1265 # @show-menubar: Display the main window menubar.  Defaults to "on".
1266 #     (Since 8.0)
1268 # Since: 2.12
1270 { 'struct'  : 'DisplayGTK',
1271   'data'    : { '*grab-on-hover' : 'bool',
1272                 '*zoom-to-fit'   : 'bool',
1273                 '*show-tabs'     : 'bool',
1274                 '*show-menubar'  : 'bool'  } }
1277 # @DisplayEGLHeadless:
1279 # EGL headless display options.
1281 # @rendernode: Which DRM render node should be used.  Default is the
1282 #     first available node on the host.
1284 # Since: 3.1
1286 { 'struct'  : 'DisplayEGLHeadless',
1287   'data'    : { '*rendernode' : 'str' } }
1290 # @DisplayDBus:
1292 # DBus display options.
1294 # @addr: The D-Bus bus address (default to the session bus).
1296 # @rendernode: Which DRM render node should be used.  Default is the
1297 #     first available node on the host.
1299 # @p2p: Whether to use peer-to-peer connections (accepted through
1300 #     @add_client).
1302 # @audiodev: Use the specified DBus audiodev to export audio.
1304 # Since: 7.0
1306 { 'struct'  : 'DisplayDBus',
1307   'data'    : { '*rendernode' : 'str',
1308                 '*addr': 'str',
1309                 '*p2p': 'bool',
1310                 '*audiodev': 'str' } }
1313 # @DisplayGLMode:
1315 # Display OpenGL mode.
1317 # @off: Disable OpenGL (default).
1319 # @on: Use OpenGL, pick context type automatically.  Would better be
1320 #     named 'auto' but is called 'on' for backward compatibility with
1321 #     bool type.
1323 # @core: Use OpenGL with Core (desktop) Context.
1325 # @es: Use OpenGL with ES (embedded systems) Context.
1327 # Since: 3.0
1329 { 'enum'    : 'DisplayGLMode',
1330   'data'    : [ 'off', 'on', 'core', 'es' ] }
1333 # @DisplayCurses:
1335 # Curses display options.
1337 # @charset: Font charset used by guest (default: CP437).
1339 # Since: 4.0
1341 { 'struct'  : 'DisplayCurses',
1342   'data'    : { '*charset'       : 'str' } }
1345 # @DisplayCocoa:
1347 # Cocoa display options.
1349 # @left-command-key: Enable/disable forwarding of left command key to
1350 #     guest.  Allows command-tab window switching on the host without
1351 #     sending this key to the guest when "off". Defaults to "on"
1353 # @full-grab: Capture all key presses, including system combos.  This
1354 #     requires accessibility permissions, since it performs a global
1355 #     grab on key events.  (default: off) See
1356 #     https://support.apple.com/en-in/guide/mac-help/mh32356/mac
1358 # @swap-opt-cmd: Swap the Option and Command keys so that their key
1359 #     codes match their position on non-Mac keyboards and you can use
1360 #     Meta/Super and Alt where you expect them.  (default: off)
1362 # Since: 7.0
1364 { 'struct': 'DisplayCocoa',
1365   'data': {
1366       '*left-command-key': 'bool',
1367       '*full-grab': 'bool',
1368       '*swap-opt-cmd': 'bool'
1369   } }
1372 # @HotKeyMod:
1374 # Set of modifier keys that need to be held for shortcut key actions.
1376 # Since: 7.1
1378 { 'enum'  : 'HotKeyMod',
1379   'data'  : [ 'lctrl-lalt', 'lshift-lctrl-lalt', 'rctrl' ] }
1382 # @DisplaySDL:
1384 # SDL2 display options.
1386 # @grab-mod: Modifier keys that should be pressed together with the
1387 #     "G" key to release the mouse grab.
1389 # Since: 7.1
1391 { 'struct'  : 'DisplaySDL',
1392   'data'    : { '*grab-mod'   : 'HotKeyMod' } }
1395 # @DisplayType:
1397 # Display (user interface) type.
1399 # @default: The default user interface, selecting from the first
1400 #     available of gtk, sdl, cocoa, and vnc.
1402 # @none: No user interface or video output display.  The guest will
1403 #     still see an emulated graphics card, but its output will not be
1404 #     displayed to the QEMU user.
1406 # @gtk: The GTK user interface.
1408 # @sdl: The SDL user interface.
1410 # @egl-headless: No user interface, offload GL operations to a local
1411 #     DRI device.  Graphical display need to be paired with VNC or
1412 #     Spice.  (Since 3.1)
1414 # @curses: Display video output via curses.  For graphics device
1415 #     models which support a text mode, QEMU can display this output
1416 #     using a curses/ncurses interface.  Nothing is displayed when the
1417 #     graphics device is in graphical mode or if the graphics device
1418 #     does not support a text mode.  Generally only the VGA device
1419 #     models support text mode.
1421 # @cocoa: The Cocoa user interface.
1423 # @spice-app: Set up a Spice server and run the default associated
1424 #     application to connect to it.  The server will redirect the
1425 #     serial console and QEMU monitors.  (Since 4.0)
1427 # @dbus: Start a D-Bus service for the display.  (Since 7.0)
1429 # Since: 2.12
1431 { 'enum'    : 'DisplayType',
1432   'data'    : [
1433     { 'name': 'default' },
1434     { 'name': 'none' },
1435     { 'name': 'gtk', 'if': 'CONFIG_GTK' },
1436     { 'name': 'sdl', 'if': 'CONFIG_SDL' },
1437     { 'name': 'egl-headless',
1438               'if': { 'all': ['CONFIG_OPENGL', 'CONFIG_GBM'] } },
1439     { 'name': 'curses', 'if': 'CONFIG_CURSES' },
1440     { 'name': 'cocoa', 'if': 'CONFIG_COCOA' },
1441     { 'name': 'spice-app', 'if': 'CONFIG_SPICE' },
1442     { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' }
1443   ]
1447 # @DisplayOptions:
1449 # Display (user interface) options.
1451 # @type: Which DisplayType qemu should use.
1453 # @full-screen: Start user interface in fullscreen mode
1454 #     (default: off).
1456 # @window-close: Allow to quit qemu with window close button
1457 #     (default: on).
1459 # @show-cursor: Force showing the mouse cursor (default: off).
1460 #     (since: 5.0)
1462 # @gl: Enable OpenGL support (default: off).
1464 # Since: 2.12
1466 { 'union'   : 'DisplayOptions',
1467   'base'    : { 'type'           : 'DisplayType',
1468                 '*full-screen'   : 'bool',
1469                 '*window-close'  : 'bool',
1470                 '*show-cursor'   : 'bool',
1471                 '*gl'            : 'DisplayGLMode' },
1472   'discriminator' : 'type',
1473   'data'    : {
1474       'gtk': { 'type': 'DisplayGTK', 'if': 'CONFIG_GTK' },
1475       'cocoa': { 'type': 'DisplayCocoa', 'if': 'CONFIG_COCOA' },
1476       'curses': { 'type': 'DisplayCurses', 'if': 'CONFIG_CURSES' },
1477       'egl-headless': { 'type': 'DisplayEGLHeadless',
1478                         'if': { 'all': ['CONFIG_OPENGL', 'CONFIG_GBM'] } },
1479       'dbus': { 'type': 'DisplayDBus', 'if': 'CONFIG_DBUS_DISPLAY' },
1480       'sdl': { 'type': 'DisplaySDL', 'if': 'CONFIG_SDL' }
1481   }
1485 # @query-display-options:
1487 # Returns information about display configuration
1489 # Returns: @DisplayOptions
1491 # Since: 3.1
1493 { 'command': 'query-display-options',
1494   'returns': 'DisplayOptions' }
1497 # @DisplayReloadType:
1499 # Available DisplayReload types.
1501 # @vnc: VNC display
1503 # Since: 6.0
1505 { 'enum': 'DisplayReloadType',
1506   'data': ['vnc'] }
1509 # @DisplayReloadOptionsVNC:
1511 # Specify the VNC reload options.
1513 # @tls-certs: reload tls certs or not.
1515 # Since: 6.0
1517 { 'struct': 'DisplayReloadOptionsVNC',
1518   'data': { '*tls-certs': 'bool' } }
1521 # @DisplayReloadOptions:
1523 # Options of the display configuration reload.
1525 # @type: Specify the display type.
1527 # Since: 6.0
1529 { 'union': 'DisplayReloadOptions',
1530   'base': {'type': 'DisplayReloadType'},
1531   'discriminator': 'type',
1532   'data': { 'vnc': 'DisplayReloadOptionsVNC' } }
1535 # @display-reload:
1537 # Reload display configuration.
1539 # Returns: Nothing on success.
1541 # Since: 6.0
1543 # Example:
1545 # -> { "execute": "display-reload",
1546 #      "arguments": { "type": "vnc", "tls-certs": true  } }
1547 # <- { "return": {} }
1549 { 'command': 'display-reload',
1550   'data': 'DisplayReloadOptions',
1551   'boxed' : true }
1554 # @DisplayUpdateType:
1556 # Available DisplayUpdate types.
1558 # @vnc: VNC display
1560 # Since: 7.1
1562 { 'enum': 'DisplayUpdateType',
1563   'data': ['vnc'] }
1566 # @DisplayUpdateOptionsVNC:
1568 # Specify the VNC reload options.
1570 # @addresses: If specified, change set of addresses to listen for
1571 #     connections.  Addresses configured for websockets are not
1572 #     touched.
1574 # Since: 7.1
1576 { 'struct': 'DisplayUpdateOptionsVNC',
1577   'data': { '*addresses': ['SocketAddress'] } }
1580 # @DisplayUpdateOptions:
1582 # Options of the display configuration reload.
1584 # @type: Specify the display type.
1586 # Since: 7.1
1588 { 'union': 'DisplayUpdateOptions',
1589   'base': {'type': 'DisplayUpdateType'},
1590   'discriminator': 'type',
1591   'data': { 'vnc': 'DisplayUpdateOptionsVNC' } }
1594 # @display-update:
1596 # Update display configuration.
1598 # Returns: Nothing on success.
1600 # Since: 7.1
1602 # Example:
1604 # -> { "execute": "display-update",
1605 #      "arguments": { "type": "vnc", "addresses":
1606 #                     [ { "type": "inet", "host": "0.0.0.0",
1607 #                         "port": "5901" } ] } }
1608 # <- { "return": {} }
1610 { 'command': 'display-update',
1611   'data': 'DisplayUpdateOptions',
1612   'boxed' : true }
1615 # @client_migrate_info:
1617 # Set migration information for remote display.  This makes the server
1618 # ask the client to automatically reconnect using the new parameters
1619 # once migration finished successfully.  Only implemented for SPICE.
1621 # @protocol: must be "spice"
1623 # @hostname: migration target hostname
1625 # @port: spice tcp port for plaintext channels
1627 # @tls-port: spice tcp port for tls-secured channels
1629 # @cert-subject: server certificate subject
1631 # Since: 0.14
1633 # Example:
1635 # -> { "execute": "client_migrate_info",
1636 #      "arguments": { "protocol": "spice",
1637 #                     "hostname": "virt42.lab.kraxel.org",
1638 #                     "port": 1234 } }
1639 # <- { "return": {} }
1641 { 'command': 'client_migrate_info',
1642   'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1643             '*tls-port': 'int', '*cert-subject': 'str' } }