xref: /openbmc/qemu/qapi/ui.json (revision 0b8f7448)
1# -*- Mode: Python -*-
2#
3
4##
5# = Remote desktop
6##
7
8{ 'include': 'sockets.json' }
9
10##
11# @set_password:
12#
13# Sets the password of a remote display session.
14#
15# @protocol: `vnc' to modify the VNC server password
16#            `spice' to modify the Spice server password
17#
18# @password: the new password
19#
20# @connected: how to handle existing clients when changing the
21#                       password.  If nothing is specified, defaults to `keep'
22#                       `fail' to fail the command if clients are connected
23#                       `disconnect' to disconnect existing clients
24#                       `keep' to maintain existing clients
25#
26# Returns: Nothing on success
27#          If Spice is not enabled, DeviceNotFound
28#
29# Since: 0.14.0
30#
31# Example:
32#
33# -> { "execute": "set_password", "arguments": { "protocol": "vnc",
34#                                                "password": "secret" } }
35# <- { "return": {} }
36#
37##
38{ 'command': 'set_password',
39  'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
40
41##
42# @expire_password:
43#
44# Expire the password of a remote display server.
45#
46# @protocol: the name of the remote display protocol `vnc' or `spice'
47#
48# @time: when to expire the password.
49#        `now' to expire the password immediately
50#        `never' to cancel password expiration
51#        `+INT' where INT is the number of seconds from now (integer)
52#        `INT' where INT is the absolute time in seconds
53#
54# Returns: Nothing on success
55#          If @protocol is `spice' and Spice is not active, DeviceNotFound
56#
57# Since: 0.14.0
58#
59# Notes: Time is relative to the server and currently there is no way to
60#        coordinate server time with client time.  It is not recommended to
61#        use the absolute time version of the @time parameter unless you're
62#        sure you are on the same machine as the QEMU instance.
63#
64# Example:
65#
66# -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
67#                                                   "time": "+60" } }
68# <- { "return": {} }
69#
70##
71{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
72
73##
74# @screendump:
75#
76# Write a PPM of the VGA screen to a file.
77#
78# @filename: the path of a new PPM file to store the image
79#
80# @device: ID of the display device that should be dumped. If this parameter
81#          is missing, the primary display will be used. (Since 2.12)
82#
83# @head: head to use in case the device supports multiple heads. If this
84#        parameter is missing, head #0 will be used. Also note that the head
85#        can only be specified in conjunction with the device ID. (Since 2.12)
86#
87# Returns: Nothing on success
88#
89# Since: 0.14.0
90#
91# Example:
92#
93# -> { "execute": "screendump",
94#      "arguments": { "filename": "/tmp/image" } }
95# <- { "return": {} }
96#
97##
98{ 'command': 'screendump',
99  'data': {'filename': 'str', '*device': 'str', '*head': 'int'} }
100
101##
102# == Spice
103##
104
105##
106# @SpiceBasicInfo:
107#
108# The basic information for SPICE network connection
109#
110# @host: IP address
111#
112# @port: port number
113#
114# @family: address family
115#
116# Since: 2.1
117##
118{ 'struct': 'SpiceBasicInfo',
119  'data': { 'host': 'str',
120            'port': 'str',
121            'family': 'NetworkAddressFamily' },
122  'if': 'defined(CONFIG_SPICE)' }
123
124##
125# @SpiceServerInfo:
126#
127# Information about a SPICE server
128#
129# @auth: authentication method
130#
131# Since: 2.1
132##
133{ 'struct': 'SpiceServerInfo',
134  'base': 'SpiceBasicInfo',
135  'data': { '*auth': 'str' },
136  'if': 'defined(CONFIG_SPICE)' }
137
138##
139# @SpiceChannel:
140#
141# Information about a SPICE client channel.
142#
143# @connection-id: SPICE connection id number.  All channels with the same id
144#                 belong to the same SPICE session.
145#
146# @channel-type: SPICE channel type number.  "1" is the main control
147#                channel, filter for this one if you want to track spice
148#                sessions only
149#
150# @channel-id: SPICE channel ID number.  Usually "0", might be different when
151#              multiple channels of the same type exist, such as multiple
152#              display channels in a multihead setup
153#
154# @tls: true if the channel is encrypted, false otherwise.
155#
156# Since: 0.14.0
157##
158{ 'struct': 'SpiceChannel',
159  'base': 'SpiceBasicInfo',
160  'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
161           'tls': 'bool'},
162  'if': 'defined(CONFIG_SPICE)' }
163
164##
165# @SpiceQueryMouseMode:
166#
167# An enumeration of Spice mouse states.
168#
169# @client: Mouse cursor position is determined by the client.
170#
171# @server: Mouse cursor position is determined by the server.
172#
173# @unknown: No information is available about mouse mode used by
174#           the spice server.
175#
176# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
177#
178# Since: 1.1
179##
180{ 'enum': 'SpiceQueryMouseMode',
181  'data': [ 'client', 'server', 'unknown' ],
182  'if': 'defined(CONFIG_SPICE)' }
183
184##
185# @SpiceInfo:
186#
187# Information about the SPICE session.
188#
189# @enabled: true if the SPICE server is enabled, false otherwise
190#
191# @migrated: true if the last guest migration completed and spice
192#            migration had completed as well. false otherwise. (since 1.4)
193#
194# @host: The hostname the SPICE server is bound to.  This depends on
195#        the name resolution on the host and may be an IP address.
196#
197# @port: The SPICE server's port number.
198#
199# @compiled-version: SPICE server version.
200#
201# @tls-port: The SPICE server's TLS port number.
202#
203# @auth: the current authentication type used by the server
204#        'none'  if no authentication is being used
205#        'spice' uses SASL or direct TLS authentication, depending on command
206#                line options
207#
208# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
209#              be determined by the client or the server, or unknown if spice
210#              server doesn't provide this information. (since: 1.1)
211#
212# @channels: a list of @SpiceChannel for each active spice channel
213#
214# Since: 0.14.0
215##
216{ 'struct': 'SpiceInfo',
217  'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
218           '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
219           'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']},
220  'if': 'defined(CONFIG_SPICE)' }
221
222##
223# @query-spice:
224#
225# Returns information about the current SPICE server
226#
227# Returns: @SpiceInfo
228#
229# Since: 0.14.0
230#
231# Example:
232#
233# -> { "execute": "query-spice" }
234# <- { "return": {
235#          "enabled": true,
236#          "auth": "spice",
237#          "port": 5920,
238#          "tls-port": 5921,
239#          "host": "0.0.0.0",
240#          "channels": [
241#             {
242#                "port": "54924",
243#                "family": "ipv4",
244#                "channel-type": 1,
245#                "connection-id": 1804289383,
246#                "host": "127.0.0.1",
247#                "channel-id": 0,
248#                "tls": true
249#             },
250#             {
251#                "port": "36710",
252#                "family": "ipv4",
253#                "channel-type": 4,
254#                "connection-id": 1804289383,
255#                "host": "127.0.0.1",
256#                "channel-id": 0,
257#                "tls": false
258#             },
259#             [ ... more channels follow ... ]
260#          ]
261#       }
262#    }
263#
264##
265{ 'command': 'query-spice', 'returns': 'SpiceInfo',
266  'if': 'defined(CONFIG_SPICE)' }
267
268##
269# @SPICE_CONNECTED:
270#
271# Emitted when a SPICE client establishes a connection
272#
273# @server: server information
274#
275# @client: client information
276#
277# Since: 0.14.0
278#
279# Example:
280#
281# <- { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
282#      "event": "SPICE_CONNECTED",
283#      "data": {
284#        "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
285#        "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
286#    }}
287#
288##
289{ 'event': 'SPICE_CONNECTED',
290  'data': { 'server': 'SpiceBasicInfo',
291            'client': 'SpiceBasicInfo' },
292  'if': 'defined(CONFIG_SPICE)' }
293
294##
295# @SPICE_INITIALIZED:
296#
297# Emitted after initial handshake and authentication takes place (if any)
298# and the SPICE channel is up and running
299#
300# @server: server information
301#
302# @client: client information
303#
304# Since: 0.14.0
305#
306# Example:
307#
308# <- { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
309#      "event": "SPICE_INITIALIZED",
310#      "data": {"server": {"auth": "spice", "port": "5921",
311#                          "family": "ipv4", "host": "127.0.0.1"},
312#               "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
313#                          "connection-id": 1804289383, "host": "127.0.0.1",
314#                          "channel-id": 0, "tls": true}
315#    }}
316#
317##
318{ 'event': 'SPICE_INITIALIZED',
319  'data': { 'server': 'SpiceServerInfo',
320            'client': 'SpiceChannel' },
321  'if': 'defined(CONFIG_SPICE)' }
322
323##
324# @SPICE_DISCONNECTED:
325#
326# Emitted when the SPICE connection is closed
327#
328# @server: server information
329#
330# @client: client information
331#
332# Since: 0.14.0
333#
334# Example:
335#
336# <- { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
337#      "event": "SPICE_DISCONNECTED",
338#      "data": {
339#        "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
340#        "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
341#    }}
342#
343##
344{ 'event': 'SPICE_DISCONNECTED',
345  'data': { 'server': 'SpiceBasicInfo',
346            'client': 'SpiceBasicInfo' },
347  'if': 'defined(CONFIG_SPICE)' }
348
349##
350# @SPICE_MIGRATE_COMPLETED:
351#
352# Emitted when SPICE migration has completed
353#
354# Since: 1.3
355#
356# Example:
357#
358# <- { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
359#      "event": "SPICE_MIGRATE_COMPLETED" }
360#
361##
362{ 'event': 'SPICE_MIGRATE_COMPLETED',
363  'if': 'defined(CONFIG_SPICE)' }
364
365##
366# == VNC
367##
368
369##
370# @VncBasicInfo:
371#
372# The basic information for vnc network connection
373#
374# @host: IP address
375#
376# @service: The service name of the vnc port. This may depend on the host
377#           system's service database so symbolic names should not be relied
378#           on.
379#
380# @family: address family
381#
382# @websocket: true in case the socket is a websocket (since 2.3).
383#
384# Since: 2.1
385##
386{ 'struct': 'VncBasicInfo',
387  'data': { 'host': 'str',
388            'service': 'str',
389            'family': 'NetworkAddressFamily',
390            'websocket': 'bool' },
391  'if': 'defined(CONFIG_VNC)' }
392
393##
394# @VncServerInfo:
395#
396# The network connection information for server
397#
398# @auth: authentication method used for
399#        the plain (non-websocket) VNC server
400#
401# Since: 2.1
402##
403{ 'struct': 'VncServerInfo',
404  'base': 'VncBasicInfo',
405  'data': { '*auth': 'str' },
406  'if': 'defined(CONFIG_VNC)' }
407
408##
409# @VncClientInfo:
410#
411# Information about a connected VNC client.
412#
413# @x509_dname: If x509 authentication is in use, the Distinguished
414#              Name of the client.
415#
416# @sasl_username: If SASL authentication is in use, the SASL username
417#                 used for authentication.
418#
419# Since: 0.14.0
420##
421{ 'struct': 'VncClientInfo',
422  'base': 'VncBasicInfo',
423  'data': { '*x509_dname': 'str', '*sasl_username': 'str' },
424  'if': 'defined(CONFIG_VNC)' }
425
426##
427# @VncInfo:
428#
429# Information about the VNC session.
430#
431# @enabled: true if the VNC server is enabled, false otherwise
432#
433# @host: The hostname the VNC server is bound to.  This depends on
434#        the name resolution on the host and may be an IP address.
435#
436# @family: 'ipv6' if the host is listening for IPv6 connections
437#                    'ipv4' if the host is listening for IPv4 connections
438#                    'unix' if the host is listening on a unix domain socket
439#                    'unknown' otherwise
440#
441# @service: The service name of the server's port.  This may depends
442#           on the host system's service database so symbolic names should not
443#           be relied on.
444#
445# @auth: the current authentication type used by the server
446#        'none' if no authentication is being used
447#        'vnc' if VNC authentication is being used
448#        'vencrypt+plain' if VEncrypt is used with plain text authentication
449#        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
450#        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
451#        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
452#        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
453#        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
454#        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
455#        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
456#        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
457#
458# @clients: a list of @VncClientInfo of all currently connected clients
459#
460# Since: 0.14.0
461##
462{ 'struct': 'VncInfo',
463  'data': {'enabled': 'bool', '*host': 'str',
464           '*family': 'NetworkAddressFamily',
465           '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']},
466  'if': 'defined(CONFIG_VNC)' }
467
468##
469# @VncPrimaryAuth:
470#
471# vnc primary authentication method.
472#
473# Since: 2.3
474##
475{ 'enum': 'VncPrimaryAuth',
476  'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
477            'tls', 'vencrypt', 'sasl' ],
478  'if': 'defined(CONFIG_VNC)' }
479
480##
481# @VncVencryptSubAuth:
482#
483# vnc sub authentication method with vencrypt.
484#
485# Since: 2.3
486##
487{ 'enum': 'VncVencryptSubAuth',
488  'data': [ 'plain',
489            'tls-none',  'x509-none',
490            'tls-vnc',   'x509-vnc',
491            'tls-plain', 'x509-plain',
492            'tls-sasl',  'x509-sasl' ],
493  'if': 'defined(CONFIG_VNC)' }
494
495##
496# @VncServerInfo2:
497#
498# The network connection information for server
499#
500# @auth: The current authentication type used by the servers
501#
502# @vencrypt: The vencrypt sub authentication type used by the
503#            servers, only specified in case auth == vencrypt.
504#
505# Since: 2.9
506##
507{ 'struct': 'VncServerInfo2',
508  'base': 'VncBasicInfo',
509  'data': { 'auth'      : 'VncPrimaryAuth',
510            '*vencrypt' : 'VncVencryptSubAuth' },
511  'if': 'defined(CONFIG_VNC)' }
512
513##
514# @VncInfo2:
515#
516# Information about a vnc server
517#
518# @id: vnc server name.
519#
520# @server: A list of @VncBasincInfo describing all listening sockets.
521#          The list can be empty (in case the vnc server is disabled).
522#          It also may have multiple entries: normal + websocket,
523#          possibly also ipv4 + ipv6 in the future.
524#
525# @clients: A list of @VncClientInfo of all currently connected clients.
526#           The list can be empty, for obvious reasons.
527#
528# @auth: The current authentication type used by the non-websockets servers
529#
530# @vencrypt: The vencrypt authentication type used by the servers,
531#            only specified in case auth == vencrypt.
532#
533# @display: The display device the vnc server is linked to.
534#
535# Since: 2.3
536##
537{ 'struct': 'VncInfo2',
538  'data': { 'id'        : 'str',
539            'server'    : ['VncServerInfo2'],
540            'clients'   : ['VncClientInfo'],
541            'auth'      : 'VncPrimaryAuth',
542            '*vencrypt' : 'VncVencryptSubAuth',
543            '*display'  : 'str' },
544  'if': 'defined(CONFIG_VNC)' }
545
546##
547# @query-vnc:
548#
549# Returns information about the current VNC server
550#
551# Returns: @VncInfo
552#
553# Since: 0.14.0
554#
555# Example:
556#
557# -> { "execute": "query-vnc" }
558# <- { "return": {
559#          "enabled":true,
560#          "host":"0.0.0.0",
561#          "service":"50402",
562#          "auth":"vnc",
563#          "family":"ipv4",
564#          "clients":[
565#             {
566#                "host":"127.0.0.1",
567#                "service":"50401",
568#                "family":"ipv4"
569#             }
570#          ]
571#       }
572#    }
573#
574##
575{ 'command': 'query-vnc', 'returns': 'VncInfo',
576  'if': 'defined(CONFIG_VNC)' }
577##
578# @query-vnc-servers:
579#
580# Returns a list of vnc servers.  The list can be empty.
581#
582# Returns: a list of @VncInfo2
583#
584# Since: 2.3
585##
586{ 'command': 'query-vnc-servers', 'returns': ['VncInfo2'],
587  'if': 'defined(CONFIG_VNC)' }
588
589##
590# @change-vnc-password:
591#
592# Change the VNC server password.
593#
594# @password:  the new password to use with VNC authentication
595#
596# Since: 1.1
597#
598# Notes:  An empty password in this command will set the password to the empty
599#         string.  Existing clients are unaffected by executing this command.
600##
601{ 'command': 'change-vnc-password', 'data': {'password': 'str'},
602  'if': 'defined(CONFIG_VNC)' }
603
604##
605# @VNC_CONNECTED:
606#
607# Emitted when a VNC client establishes a connection
608#
609# @server: server information
610#
611# @client: client information
612#
613# Note: This event is emitted before any authentication takes place, thus
614# the authentication ID is not provided
615#
616# Since: 0.13.0
617#
618# Example:
619#
620# <- { "event": "VNC_CONNECTED",
621#      "data": {
622#            "server": { "auth": "sasl", "family": "ipv4",
623#                        "service": "5901", "host": "0.0.0.0" },
624#            "client": { "family": "ipv4", "service": "58425",
625#                        "host": "127.0.0.1" } },
626#      "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
627#
628##
629{ 'event': 'VNC_CONNECTED',
630  'data': { 'server': 'VncServerInfo',
631            'client': 'VncBasicInfo' },
632  'if': 'defined(CONFIG_VNC)' }
633
634##
635# @VNC_INITIALIZED:
636#
637# Emitted after authentication takes place (if any) and the VNC session is
638# made active
639#
640# @server: server information
641#
642# @client: client information
643#
644# Since: 0.13.0
645#
646# Example:
647#
648# <-  { "event": "VNC_INITIALIZED",
649#       "data": {
650#            "server": { "auth": "sasl", "family": "ipv4",
651#                        "service": "5901", "host": "0.0.0.0"},
652#            "client": { "family": "ipv4", "service": "46089",
653#                        "host": "127.0.0.1", "sasl_username": "luiz" } },
654#       "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
655#
656##
657{ 'event': 'VNC_INITIALIZED',
658  'data': { 'server': 'VncServerInfo',
659            'client': 'VncClientInfo' },
660  'if': 'defined(CONFIG_VNC)' }
661
662##
663# @VNC_DISCONNECTED:
664#
665# Emitted when the connection is closed
666#
667# @server: server information
668#
669# @client: client information
670#
671# Since: 0.13.0
672#
673# Example:
674#
675# <- { "event": "VNC_DISCONNECTED",
676#      "data": {
677#            "server": { "auth": "sasl", "family": "ipv4",
678#                        "service": "5901", "host": "0.0.0.0" },
679#            "client": { "family": "ipv4", "service": "58425",
680#                        "host": "127.0.0.1", "sasl_username": "luiz" } },
681#      "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
682#
683##
684{ 'event': 'VNC_DISCONNECTED',
685  'data': { 'server': 'VncServerInfo',
686            'client': 'VncClientInfo' },
687  'if': 'defined(CONFIG_VNC)' }
688
689##
690# = Input
691##
692
693##
694# @MouseInfo:
695#
696# Information about a mouse device.
697#
698# @name: the name of the mouse device
699#
700# @index: the index of the mouse device
701#
702# @current: true if this device is currently receiving mouse events
703#
704# @absolute: true if this device supports absolute coordinates as input
705#
706# Since: 0.14.0
707##
708{ 'struct': 'MouseInfo',
709  'data': {'name': 'str', 'index': 'int', 'current': 'bool',
710           'absolute': 'bool'} }
711
712##
713# @query-mice:
714#
715# Returns information about each active mouse device
716#
717# Returns: a list of @MouseInfo for each device
718#
719# Since: 0.14.0
720#
721# Example:
722#
723# -> { "execute": "query-mice" }
724# <- { "return": [
725#          {
726#             "name":"QEMU Microsoft Mouse",
727#             "index":0,
728#             "current":false,
729#             "absolute":false
730#          },
731#          {
732#             "name":"QEMU PS/2 Mouse",
733#             "index":1,
734#             "current":true,
735#             "absolute":true
736#          }
737#       ]
738#    }
739#
740##
741{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
742
743##
744# @QKeyCode:
745#
746# An enumeration of key name.
747#
748# This is used by the @send-key command.
749#
750# @unmapped: since 2.0
751# @pause: since 2.0
752# @ro: since 2.4
753# @kp_comma: since 2.4
754# @kp_equals: since 2.6
755# @power: since 2.6
756# @hiragana: since 2.9
757# @henkan: since 2.9
758# @yen: since 2.9
759#
760# @sleep: since 2.10
761# @wake: since 2.10
762# @audionext: since 2.10
763# @audioprev: since 2.10
764# @audiostop: since 2.10
765# @audioplay: since 2.10
766# @audiomute: since 2.10
767# @volumeup: since 2.10
768# @volumedown: since 2.10
769# @mediaselect: since 2.10
770# @mail: since 2.10
771# @calculator: since 2.10
772# @computer: since 2.10
773# @ac_home: since 2.10
774# @ac_back: since 2.10
775# @ac_forward: since 2.10
776# @ac_refresh: since 2.10
777# @ac_bookmarks: since 2.10
778# altgr, altgr_r: dropped in 2.10
779#
780# @muhenkan: since 2.12
781# @katakanahiragana: since 2.12
782#
783# 'sysrq' was mistakenly added to hack around the fact that
784# the ps2 driver was not generating correct scancodes sequences
785# when 'alt+print' was pressed. This flaw is now fixed and the
786# 'sysrq' key serves no further purpose. Any further use of
787# 'sysrq' will be transparently changed to 'print', so they
788# are effectively synonyms.
789#
790# Since: 1.3.0
791#
792##
793{ 'enum': 'QKeyCode',
794  'data': [ 'unmapped',
795            'shift', 'shift_r', 'alt', 'alt_r', 'ctrl',
796            'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
797            '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
798            'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
799            'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
800            'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
801            'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
802            'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
803            'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
804            'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
805            'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
806            'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
807            'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
808            'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
809            'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
810            'ro', 'hiragana', 'henkan', 'yen', 'muhenkan', 'katakanahiragana',
811            'kp_comma', 'kp_equals', 'power', 'sleep', 'wake',
812            'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
813            'volumeup', 'volumedown', 'mediaselect',
814            'mail', 'calculator', 'computer',
815            'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
816
817##
818# @KeyValue:
819#
820# Represents a keyboard key.
821#
822# Since: 1.3.0
823##
824{ 'union': 'KeyValue',
825  'data': {
826    'number': 'int',
827    'qcode': 'QKeyCode' } }
828
829##
830# @send-key:
831#
832# Send keys to guest.
833#
834# @keys: An array of @KeyValue elements. All @KeyValues in this array are
835#        simultaneously sent to the guest. A @KeyValue.number value is sent
836#        directly to the guest, while @KeyValue.qcode must be a valid
837#        @QKeyCode value
838#
839# @hold-time: time to delay key up events, milliseconds. Defaults
840#             to 100
841#
842# Returns: Nothing on success
843#          If key is unknown or redundant, InvalidParameter
844#
845# Since: 1.3.0
846#
847# Example:
848#
849# -> { "execute": "send-key",
850#      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
851#                               { "type": "qcode", "data": "alt" },
852#                               { "type": "qcode", "data": "delete" } ] } }
853# <- { "return": {} }
854#
855##
856{ 'command': 'send-key',
857  'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
858
859##
860# @InputButton:
861#
862# Button of a pointer input device (mouse, tablet).
863#
864# @side: front side button of a 5-button mouse (since 2.9)
865#
866# @extra: rear side button of a 5-button mouse (since 2.9)
867#
868# Since: 2.0
869##
870{ 'enum'  : 'InputButton',
871  'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
872  'extra' ] }
873
874##
875# @InputAxis:
876#
877# Position axis of a pointer input device (mouse, tablet).
878#
879# Since: 2.0
880##
881{ 'enum'  : 'InputAxis',
882  'data'  : [ 'x', 'y' ] }
883
884##
885# @InputKeyEvent:
886#
887# Keyboard input event.
888#
889# @key:    Which key this event is for.
890# @down:   True for key-down and false for key-up events.
891#
892# Since: 2.0
893##
894{ 'struct'  : 'InputKeyEvent',
895  'data'  : { 'key'     : 'KeyValue',
896              'down'    : 'bool' } }
897
898##
899# @InputBtnEvent:
900#
901# Pointer button input event.
902#
903# @button: Which button this event is for.
904# @down:   True for key-down and false for key-up events.
905#
906# Since: 2.0
907##
908{ 'struct'  : 'InputBtnEvent',
909  'data'  : { 'button'  : 'InputButton',
910              'down'    : 'bool' } }
911
912##
913# @InputMoveEvent:
914#
915# Pointer motion input event.
916#
917# @axis:   Which axis is referenced by @value.
918# @value:  Pointer position.  For absolute coordinates the
919#          valid range is 0 -> 0x7ffff
920#
921# Since: 2.0
922##
923{ 'struct'  : 'InputMoveEvent',
924  'data'  : { 'axis'    : 'InputAxis',
925              'value'   : 'int' } }
926
927##
928# @InputEvent:
929#
930# Input event union.
931#
932# @type: the input type, one of:
933#  - 'key': Input event of Keyboard
934#  - 'btn': Input event of pointer buttons
935#  - 'rel': Input event of relative pointer motion
936#  - 'abs': Input event of absolute pointer motion
937#
938# Since: 2.0
939##
940{ 'union' : 'InputEvent',
941  'data'  : { 'key'     : 'InputKeyEvent',
942              'btn'     : 'InputBtnEvent',
943              'rel'     : 'InputMoveEvent',
944              'abs'     : 'InputMoveEvent' } }
945
946##
947# @input-send-event:
948#
949# Send input event(s) to guest.
950#
951# @device: display device to send event(s) to.
952# @head: head to send event(s) to, in case the
953#        display device supports multiple scanouts.
954# @events: List of InputEvent union.
955#
956# Returns: Nothing on success.
957#
958# The @device and @head parameters can be used to send the input event
959# to specific input devices in case (a) multiple input devices of the
960# same kind are added to the virtual machine and (b) you have
961# configured input routing (see docs/multiseat.txt) for those input
962# devices.  The parameters work exactly like the device and head
963# properties of input devices.  If @device is missing, only devices
964# that have no input routing config are admissible.  If @device is
965# specified, both input devices with and without input routing config
966# are admissible, but devices with input routing config take
967# precedence.
968#
969# Since: 2.6
970#
971# Note: The consoles are visible in the qom tree, under
972# /backend/console[$index]. They have a device link and head property,
973# so it is possible to map which console belongs to which device and
974# display.
975#
976# Example:
977#
978# 1. Press left mouse button.
979#
980# -> { "execute": "input-send-event",
981#     "arguments": { "device": "video0",
982#                    "events": [ { "type": "btn",
983#                    "data" : { "down": true, "button": "left" } } ] } }
984# <- { "return": {} }
985#
986# -> { "execute": "input-send-event",
987#     "arguments": { "device": "video0",
988#                    "events": [ { "type": "btn",
989#                    "data" : { "down": false, "button": "left" } } ] } }
990# <- { "return": {} }
991#
992# 2. Press ctrl-alt-del.
993#
994# -> { "execute": "input-send-event",
995#      "arguments": { "events": [
996#         { "type": "key", "data" : { "down": true,
997#           "key": {"type": "qcode", "data": "ctrl" } } },
998#         { "type": "key", "data" : { "down": true,
999#           "key": {"type": "qcode", "data": "alt" } } },
1000#         { "type": "key", "data" : { "down": true,
1001#           "key": {"type": "qcode", "data": "delete" } } } ] } }
1002# <- { "return": {} }
1003#
1004# 3. Move mouse pointer to absolute coordinates (20000, 400).
1005#
1006# -> { "execute": "input-send-event" ,
1007#   "arguments": { "events": [
1008#                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
1009#                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
1010# <- { "return": {} }
1011#
1012##
1013{ 'command': 'input-send-event',
1014  'data': { '*device': 'str',
1015            '*head'  : 'int',
1016            'events' : [ 'InputEvent' ] } }
1017
1018
1019##
1020# @DisplayGTK:
1021#
1022# GTK display options.
1023#
1024# @grab-on-hover: Grab keyboard input on mouse hover.
1025# @zoom-to-fit: Zoom guest display to fit into the host window.  When
1026#               turned off the host window will be resized instead.
1027#               In case the display device can notify the guest on
1028#               window resizes (virtio-gpu) this will default to "on",
1029#               assuming the guest will resize the display to match
1030#               the window size then.  Otherwise it defaults to "off".
1031#               Since 3.1
1032#
1033# Since: 2.12
1034#
1035##
1036{ 'struct'  : 'DisplayGTK',
1037  'data'    : { '*grab-on-hover' : 'bool',
1038                '*zoom-to-fit'   : 'bool'  } }
1039
1040 ##
1041 # @DisplayGLMode:
1042 #
1043 # Display OpenGL mode.
1044 #
1045 # @off: Disable OpenGL (default).
1046 # @on: Use OpenGL, pick context type automatically.
1047 #      Would better be named 'auto' but is called 'on' for backward
1048 #      compatibility with bool type.
1049 # @core: Use OpenGL with Core (desktop) Context.
1050 # @es: Use OpenGL with ES (embedded systems) Context.
1051 #
1052 # Since: 3.0
1053 #
1054 ##
1055 { 'enum'    : 'DisplayGLMode',
1056   'data'    : [ 'off', 'on', 'core', 'es' ] }
1057
1058##
1059# @DisplayType:
1060#
1061# Display (user interface) type.
1062#
1063# Since: 2.12
1064#
1065##
1066{ 'enum'    : 'DisplayType',
1067  'data'    : [ 'default', 'none', 'gtk', 'sdl',
1068                'egl-headless', 'curses', 'cocoa' ] }
1069
1070##
1071# @DisplayOptions:
1072#
1073# Display (user interface) options.
1074#
1075# @type:          Which DisplayType qemu should use.
1076# @full-screen:   Start user interface in fullscreen mode (default: off).
1077# @window-close:  Allow to quit qemu with window close button (default: on).
1078# @gl:            Enable OpenGL support (default: off).
1079#
1080# Since: 2.12
1081#
1082##
1083{ 'union'   : 'DisplayOptions',
1084  'base'    : { 'type'           : 'DisplayType',
1085                '*full-screen'   : 'bool',
1086                '*window-close'  : 'bool',
1087                '*gl'            : 'DisplayGLMode' },
1088  'discriminator' : 'type',
1089  'data'    : { 'gtk'            : 'DisplayGTK' } }
1090