tcg: Add INDEX_op_qemu_{ld,st}_i128
[qemu/ar7.git] / qapi / char.json
blobe413ac2b704d424be6b8a32f7cb91a73c6e78e02
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = Character devices
7 ##
9 { 'include': 'sockets.json' }
12 # @ChardevInfo:
14 # Information about a character device.
16 # @label: the label of the character device
18 # @filename: the filename of the character device
20 # @frontend-open: shows whether the frontend device attached to this
21 #     backend (eg. with the chardev=... option) is in open or closed
22 #     state (since 2.1)
24 # Notes: @filename is encoded using the QEMU command line character
25 #     device encoding.  See the QEMU man page for details.
27 # Since: 0.14
29 { 'struct': 'ChardevInfo',
30   'data': { 'label': 'str',
31             'filename': 'str',
32             'frontend-open': 'bool' } }
35 # @query-chardev:
37 # Returns information about current character devices.
39 # Returns: a list of @ChardevInfo
41 # Since: 0.14
43 # Example:
45 # -> { "execute": "query-chardev" }
46 # <- {
47 #       "return": [
48 #          {
49 #             "label": "charchannel0",
50 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server=on",
51 #             "frontend-open": false
52 #          },
53 #          {
54 #             "label": "charmonitor",
55 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server=on",
56 #             "frontend-open": true
57 #          },
58 #          {
59 #             "label": "charserial0",
60 #             "filename": "pty:/dev/pts/2",
61 #             "frontend-open": true
62 #          }
63 #       ]
64 #    }
66 { 'command': 'query-chardev', 'returns': ['ChardevInfo'],
67   'allow-preconfig': true }
70 # @ChardevBackendInfo:
72 # Information about a character device backend
74 # @name: The backend name
76 # Since: 2.0
78 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
81 # @query-chardev-backends:
83 # Returns information about character device backends.
85 # Returns: a list of @ChardevBackendInfo
87 # Since: 2.0
89 # Example:
91 # -> { "execute": "query-chardev-backends" }
92 # <- {
93 #       "return":[
94 #          {
95 #             "name":"udp"
96 #          },
97 #          {
98 #             "name":"tcp"
99 #          },
100 #          {
101 #             "name":"unix"
102 #          },
103 #          {
104 #             "name":"spiceport"
105 #          }
106 #       ]
107 #    }
109 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
112 # @DataFormat:
114 # An enumeration of data format.
116 # @utf8: Data is a UTF-8 string (RFC 3629)
118 # @base64: Data is Base64 encoded binary (RFC 3548)
120 # Since: 1.4
122 { 'enum': 'DataFormat',
123   'data': [ 'utf8', 'base64' ] }
126 # @ringbuf-write:
128 # Write to a ring buffer character device.
130 # @device: the ring buffer character device name
132 # @data: data to write
134 # @format: data encoding (default 'utf8').
136 #     - base64: data must be base64 encoded text.  Its binary decoding
137 #       gets written.
138 #     - utf8: data's UTF-8 encoding is written
139 #     - data itself is always Unicode regardless of format, like any
140 #       other string.
142 # Returns: Nothing on success
144 # Since: 1.4
146 # Example:
148 # -> { "execute": "ringbuf-write",
149 #      "arguments": { "device": "foo",
150 #                     "data": "abcdefgh",
151 #                     "format": "utf8" } }
152 # <- { "return": {} }
154 { 'command': 'ringbuf-write',
155   'data': { 'device': 'str',
156             'data': 'str',
157            '*format': 'DataFormat'} }
160 # @ringbuf-read:
162 # Read from a ring buffer character device.
164 # @device: the ring buffer character device name
166 # @size: how many bytes to read at most
168 # @format: data encoding (default 'utf8').
170 #     - base64: the data read is returned in base64 encoding.
171 #     - utf8: the data read is interpreted as UTF-8.
172 #       Bug: can screw up when the buffer contains invalid UTF-8
173 #       sequences, NUL characters, after the ring buffer lost data,
174 #       and when reading stops because the size limit is reached.
175 #     - The return value is always Unicode regardless of format, like
176 #       any other string.
178 # Returns: data read from the device
180 # Since: 1.4
182 # Example:
184 # -> { "execute": "ringbuf-read",
185 #      "arguments": { "device": "foo",
186 #                     "size": 1000,
187 #                     "format": "utf8" } }
188 # <- { "return": "abcdefgh" }
190 { 'command': 'ringbuf-read',
191   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
192   'returns': 'str' }
195 # @ChardevCommon:
197 # Configuration shared across all chardev backends
199 # @logfile: The name of a logfile to save output
201 # @logappend: true to append instead of truncate (default to false to
202 #     truncate)
204 # Since: 2.6
206 { 'struct': 'ChardevCommon',
207   'data': { '*logfile': 'str',
208             '*logappend': 'bool' } }
211 # @ChardevFile:
213 # Configuration info for file chardevs.
215 # @in: The name of the input file
217 # @out: The name of the output file
219 # @append: Open the file in append mode (default false to truncate)
220 #     (Since 2.6)
222 # Since: 1.4
224 { 'struct': 'ChardevFile',
225   'data': { '*in': 'str',
226             'out': 'str',
227             '*append': 'bool' },
228   'base': 'ChardevCommon' }
231 # @ChardevHostdev:
233 # Configuration info for device and pipe chardevs.
235 # @device: The name of the special file for the device, i.e.
236 #     /dev/ttyS0 on Unix or COM1: on Windows
238 # Since: 1.4
240 { 'struct': 'ChardevHostdev',
241   'data': { 'device': 'str' },
242   'base': 'ChardevCommon' }
245 # @ChardevSocket:
247 # Configuration info for (stream) socket chardevs.
249 # @addr: socket address to listen on (server=true) or connect to
250 #     (server=false)
252 # @tls-creds: the ID of the TLS credentials object (since 2.6)
254 # @tls-authz: the ID of the QAuthZ authorization object against which
255 #     the client's x509 distinguished name will be validated.  This
256 #     object is only resolved at time of use, so can be deleted and
257 #     recreated on the fly while the chardev server is active.  If
258 #     missing, it will default to denying access (since 4.0)
260 # @server: create server socket (default: true)
262 # @wait: wait for incoming connection on server sockets (default:
263 #     false). Silently ignored with server: false.  This use is
264 #     deprecated.
266 # @nodelay: set TCP_NODELAY socket option (default: false)
268 # @telnet: enable telnet protocol on server sockets (default: false)
270 # @tn3270: enable tn3270 protocol on server sockets (default: false)
271 #     (Since: 2.10)
273 # @websocket: enable websocket protocol on server sockets
274 #     (default: false) (Since: 3.1)
276 # @reconnect: For a client socket, if a socket is disconnected, then
277 #     attempt a reconnect after the given number of seconds.  Setting
278 #     this to zero disables this function.  (default: 0) (Since: 2.2)
280 # Since: 1.4
282 { 'struct': 'ChardevSocket',
283   'data': { 'addr': 'SocketAddressLegacy',
284             '*tls-creds': 'str',
285             '*tls-authz'  : 'str',
286             '*server': 'bool',
287             '*wait': 'bool',
288             '*nodelay': 'bool',
289             '*telnet': 'bool',
290             '*tn3270': 'bool',
291             '*websocket': 'bool',
292             '*reconnect': 'int' },
293   'base': 'ChardevCommon' }
296 # @ChardevUdp:
298 # Configuration info for datagram socket chardevs.
300 # @remote: remote address
302 # @local: local address
304 # Since: 1.5
306 { 'struct': 'ChardevUdp',
307   'data': { 'remote': 'SocketAddressLegacy',
308             '*local': 'SocketAddressLegacy' },
309   'base': 'ChardevCommon' }
312 # @ChardevMux:
314 # Configuration info for mux chardevs.
316 # @chardev: name of the base chardev.
318 # Since: 1.5
320 { 'struct': 'ChardevMux',
321   'data': { 'chardev': 'str' },
322   'base': 'ChardevCommon' }
325 # @ChardevStdio:
327 # Configuration info for stdio chardevs.
329 # @signal: Allow signals (such as SIGINT triggered by ^C) be delivered
330 #     to qemu.  Default: true.
332 # Since: 1.5
334 { 'struct': 'ChardevStdio',
335   'data': { '*signal': 'bool' },
336   'base': 'ChardevCommon' }
339 # @ChardevSpiceChannel:
341 # Configuration info for spice vm channel chardevs.
343 # @type: kind of channel (for example vdagent).
345 # Since: 1.5
347 { 'struct': 'ChardevSpiceChannel',
348   'data': { 'type': 'str' },
349   'base': 'ChardevCommon',
350   'if': 'CONFIG_SPICE' }
353 # @ChardevSpicePort:
355 # Configuration info for spice port chardevs.
357 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
359 # Since: 1.5
361 { 'struct': 'ChardevSpicePort',
362   'data': { 'fqdn': 'str' },
363   'base': 'ChardevCommon',
364   'if': 'CONFIG_SPICE' }
367 # @ChardevDBus:
369 # Configuration info for DBus chardevs.
371 # @name: name of the channel (following docs/spice-port-fqdn.txt)
373 # Since: 7.0
375 { 'struct': 'ChardevDBus',
376   'data': { 'name': 'str' },
377   'base': 'ChardevCommon',
378   'if': 'CONFIG_DBUS_DISPLAY' }
381 # @ChardevVC:
383 # Configuration info for virtual console chardevs.
385 # @width: console width, in pixels
387 # @height: console height, in pixels
389 # @cols: console width, in chars
391 # @rows: console height, in chars
393 # Since: 1.5
395 { 'struct': 'ChardevVC',
396   'data': { '*width': 'int',
397             '*height': 'int',
398             '*cols': 'int',
399             '*rows': 'int' },
400   'base': 'ChardevCommon' }
403 # @ChardevRingbuf:
405 # Configuration info for ring buffer chardevs.
407 # @size: ring buffer size, must be power of two, default is 65536
409 # Since: 1.5
411 { 'struct': 'ChardevRingbuf',
412   'data': { '*size': 'int' },
413   'base': 'ChardevCommon' }
416 # @ChardevQemuVDAgent:
418 # Configuration info for qemu vdagent implementation.
420 # @mouse: enable/disable mouse, default is enabled.
422 # @clipboard: enable/disable clipboard, default is disabled.
424 # Since: 6.1
426 { 'struct': 'ChardevQemuVDAgent',
427   'data': { '*mouse': 'bool',
428             '*clipboard': 'bool' },
429   'base': 'ChardevCommon',
430   'if': 'CONFIG_SPICE_PROTOCOL' }
433 # @ChardevBackendKind:
435 # @pipe: Since 1.5
437 # @udp: Since 1.5
439 # @mux: Since 1.5
441 # @msmouse: Since 1.5
443 # @wctablet: Since 2.9
445 # @braille: Since 1.5
447 # @testdev: Since 2.2
449 # @stdio: Since 1.5
451 # @console: Since 1.5
453 # @spicevmc: Since 1.5
455 # @spiceport: Since 1.5
457 # @qemu-vdagent: Since 6.1
459 # @dbus: Since 7.0
461 # @vc: v1.5
463 # @ringbuf: Since 1.6
465 # @memory: Since 1.5
467 # Since: 1.4
469 { 'enum': 'ChardevBackendKind',
470   'data': [ 'file',
471             'serial',
472             'parallel',
473             'pipe',
474             'socket',
475             'udp',
476             'pty',
477             'null',
478             'mux',
479             'msmouse',
480             'wctablet',
481             'braille',
482             'testdev',
483             'stdio',
484             'console',
485             { 'name': 'spicevmc', 'if': 'CONFIG_SPICE' },
486             { 'name': 'spiceport', 'if': 'CONFIG_SPICE' },
487             { 'name': 'qemu-vdagent', 'if': 'CONFIG_SPICE_PROTOCOL' },
488             { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
489             'vc',
490             'ringbuf',
491             # next one is just for compatibility
492             'memory' ] }
495 # @ChardevFileWrapper:
497 # Since: 1.4
499 { 'struct': 'ChardevFileWrapper',
500   'data': { 'data': 'ChardevFile' } }
503 # @ChardevHostdevWrapper:
505 # Since: 1.4
507 { 'struct': 'ChardevHostdevWrapper',
508   'data': { 'data': 'ChardevHostdev' } }
511 # @ChardevSocketWrapper:
513 # Since: 1.4
515 { 'struct': 'ChardevSocketWrapper',
516   'data': { 'data': 'ChardevSocket' } }
519 # @ChardevUdpWrapper:
521 # Since: 1.5
523 { 'struct': 'ChardevUdpWrapper',
524   'data': { 'data': 'ChardevUdp' } }
527 # @ChardevCommonWrapper:
529 # Since: 2.6
531 { 'struct': 'ChardevCommonWrapper',
532   'data': { 'data': 'ChardevCommon' } }
535 # @ChardevMuxWrapper:
537 # Since: 1.5
539 { 'struct': 'ChardevMuxWrapper',
540   'data': { 'data': 'ChardevMux' } }
543 # @ChardevStdioWrapper:
545 # Since: 1.5
547 { 'struct': 'ChardevStdioWrapper',
548   'data': { 'data': 'ChardevStdio' } }
551 # @ChardevSpiceChannelWrapper:
553 # Since: 1.5
555 { 'struct': 'ChardevSpiceChannelWrapper',
556   'data': { 'data': 'ChardevSpiceChannel' },
557   'if': 'CONFIG_SPICE' }
560 # @ChardevSpicePortWrapper:
562 # Since: 1.5
564 { 'struct': 'ChardevSpicePortWrapper',
565   'data': { 'data': 'ChardevSpicePort' },
566   'if': 'CONFIG_SPICE' }
569 # @ChardevQemuVDAgentWrapper:
571 # Since: 6.1
573 { 'struct': 'ChardevQemuVDAgentWrapper',
574   'data': { 'data': 'ChardevQemuVDAgent' },
575   'if': 'CONFIG_SPICE_PROTOCOL' }
578 # @ChardevDBusWrapper:
580 # Since: 7.0
582 { 'struct': 'ChardevDBusWrapper',
583   'data': { 'data': 'ChardevDBus' },
584   'if': 'CONFIG_DBUS_DISPLAY' }
587 # @ChardevVCWrapper:
589 # Since: 1.5
591 { 'struct': 'ChardevVCWrapper',
592   'data': { 'data': 'ChardevVC' } }
595 # @ChardevRingbufWrapper:
597 # Since: 1.5
599 { 'struct': 'ChardevRingbufWrapper',
600   'data': { 'data': 'ChardevRingbuf' } }
603 # @ChardevBackend:
605 # Configuration info for the new chardev backend.
607 # Since: 1.4
609 { 'union': 'ChardevBackend',
610   'base': { 'type': 'ChardevBackendKind' },
611   'discriminator': 'type',
612   'data': { 'file': 'ChardevFileWrapper',
613             'serial': 'ChardevHostdevWrapper',
614             'parallel': 'ChardevHostdevWrapper',
615             'pipe': 'ChardevHostdevWrapper',
616             'socket': 'ChardevSocketWrapper',
617             'udp': 'ChardevUdpWrapper',
618             'pty': 'ChardevCommonWrapper',
619             'null': 'ChardevCommonWrapper',
620             'mux': 'ChardevMuxWrapper',
621             'msmouse': 'ChardevCommonWrapper',
622             'wctablet': 'ChardevCommonWrapper',
623             'braille': 'ChardevCommonWrapper',
624             'testdev': 'ChardevCommonWrapper',
625             'stdio': 'ChardevStdioWrapper',
626             'console': 'ChardevCommonWrapper',
627             'spicevmc': { 'type': 'ChardevSpiceChannelWrapper',
628                           'if': 'CONFIG_SPICE' },
629             'spiceport': { 'type': 'ChardevSpicePortWrapper',
630                            'if': 'CONFIG_SPICE' },
631             'qemu-vdagent': { 'type': 'ChardevQemuVDAgentWrapper',
632                               'if': 'CONFIG_SPICE_PROTOCOL' },
633             'dbus': { 'type': 'ChardevDBusWrapper',
634                       'if': 'CONFIG_DBUS_DISPLAY' },
635             'vc': 'ChardevVCWrapper',
636             'ringbuf': 'ChardevRingbufWrapper',
637             # next one is just for compatibility
638             'memory': 'ChardevRingbufWrapper' } }
641 # @ChardevReturn:
643 # Return info about the chardev backend just created.
645 # @pty: name of the slave pseudoterminal device, present if and only
646 #     if a chardev of type 'pty' was created
648 # Since: 1.4
650 { 'struct' : 'ChardevReturn',
651   'data': { '*pty': 'str' } }
654 # @chardev-add:
656 # Add a character device backend
658 # @id: the chardev's ID, must be unique
660 # @backend: backend type and parameters
662 # Returns: ChardevReturn.
664 # Since: 1.4
666 # Examples:
668 # -> { "execute" : "chardev-add",
669 #      "arguments" : { "id" : "foo",
670 #                      "backend" : { "type" : "null", "data" : {} } } }
671 # <- { "return": {} }
673 # -> { "execute" : "chardev-add",
674 #      "arguments" : { "id" : "bar",
675 #                      "backend" : { "type" : "file",
676 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
677 # <- { "return": {} }
679 # -> { "execute" : "chardev-add",
680 #      "arguments" : { "id" : "baz",
681 #                      "backend" : { "type" : "pty", "data" : {} } } }
682 # <- { "return": { "pty" : "/dev/pty/42" } }
684 { 'command': 'chardev-add',
685   'data': { 'id': 'str',
686             'backend': 'ChardevBackend' },
687   'returns': 'ChardevReturn' }
690 # @chardev-change:
692 # Change a character device backend
694 # @id: the chardev's ID, must exist
696 # @backend: new backend type and parameters
698 # Returns: ChardevReturn.
700 # Since: 2.10
702 # Examples:
704 # -> { "execute" : "chardev-change",
705 #      "arguments" : { "id" : "baz",
706 #                      "backend" : { "type" : "pty", "data" : {} } } }
707 # <- { "return": { "pty" : "/dev/pty/42" } }
709 # -> {"execute" : "chardev-change",
710 #     "arguments" : {
711 #         "id" : "charchannel2",
712 #         "backend" : {
713 #             "type" : "socket",
714 #             "data" : {
715 #                 "addr" : {
716 #                     "type" : "unix" ,
717 #                     "data" : {
718 #                         "path" : "/tmp/charchannel2.socket"
719 #                     }
720 #                  },
721 #                  "server" : true,
722 #                  "wait" : false }}}}
723 # <- {"return": {}}
725 { 'command': 'chardev-change',
726   'data': { 'id': 'str',
727             'backend': 'ChardevBackend' },
728   'returns': 'ChardevReturn' }
731 # @chardev-remove:
733 # Remove a character device backend
735 # @id: the chardev's ID, must exist and not be in use
737 # Returns: Nothing on success
739 # Since: 1.4
741 # Example:
743 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
744 # <- { "return": {} }
746 { 'command': 'chardev-remove',
747   'data': { 'id': 'str' } }
750 # @chardev-send-break:
752 # Send a break to a character device
754 # @id: the chardev's ID, must exist
756 # Returns: Nothing on success
758 # Since: 2.10
760 # Example:
762 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
763 # <- { "return": {} }
765 { 'command': 'chardev-send-break',
766   'data': { 'id': 'str' } }
769 # @VSERPORT_CHANGE:
771 # Emitted when the guest opens or closes a virtio-serial port.
773 # @id: device identifier of the virtio-serial port
775 # @open: true if the guest has opened the virtio-serial port
777 # Note: This event is rate-limited.
779 # Since: 2.1
781 # Example:
783 # <- { "event": "VSERPORT_CHANGE",
784 #      "data": { "id": "channel0", "open": true },
785 #      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
787 { 'event': 'VSERPORT_CHANGE',
788   'data': { 'id': 'str',
789             'open': 'bool' } }