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