hw/intc/sh_intc: Inline and drop sh_intc_source() function
[qemu/rayw.git] / qapi / char.json
blobf5133a5eeb372de126f12e267ec78cfdd1b82b96
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 backend
21 #                 (eg. with the chardev=... option) is in open or closed state
22 #                 (since 2.1)
24 # Notes: @filename is encoded using the QEMU command line character device
25 #        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 #    }
67 { 'command': 'query-chardev', 'returns': ['ChardevInfo'],
68   'allow-preconfig': true }
71 # @ChardevBackendInfo:
73 # Information about a character device backend
75 # @name: The backend name
77 # Since: 2.0
79 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
82 # @query-chardev-backends:
84 # Returns information about character device backends.
86 # Returns: a list of @ChardevBackendInfo
88 # Since: 2.0
90 # Example:
92 # -> { "execute": "query-chardev-backends" }
93 # <- {
94 #       "return":[
95 #          {
96 #             "name":"udp"
97 #          },
98 #          {
99 #             "name":"tcp"
100 #          },
101 #          {
102 #             "name":"unix"
103 #          },
104 #          {
105 #             "name":"spiceport"
106 #          }
107 #       ]
108 #    }
111 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
114 # @DataFormat:
116 # An enumeration of data format.
118 # @utf8: Data is a UTF-8 string (RFC 3629)
120 # @base64: Data is Base64 encoded binary (RFC 3548)
122 # Since: 1.4
124 { 'enum': 'DataFormat',
125   'data': [ 'utf8', 'base64' ] }
128 # @ringbuf-write:
130 # Write to a ring buffer character device.
132 # @device: the ring buffer character device name
134 # @data: data to write
136 # @format: data encoding (default 'utf8').
138 #          - base64: data must be base64 encoded text.  Its binary
139 #            decoding gets written.
140 #          - utf8: data's UTF-8 encoding is written
141 #          - data itself is always Unicode regardless of format, like
142 #            any other string.
144 # Returns: Nothing on success
146 # Since: 1.4
148 # Example:
150 # -> { "execute": "ringbuf-write",
151 #      "arguments": { "device": "foo",
152 #                     "data": "abcdefgh",
153 #                     "format": "utf8" } }
154 # <- { "return": {} }
157 { 'command': 'ringbuf-write',
158   'data': { 'device': 'str',
159             'data': 'str',
160            '*format': 'DataFormat'} }
163 # @ringbuf-read:
165 # Read from a ring buffer character device.
167 # @device: the ring buffer character device name
169 # @size: how many bytes to read at most
171 # @format: data encoding (default 'utf8').
173 #          - base64: the data read is returned in base64 encoding.
174 #          - utf8: the data read is interpreted as UTF-8.
175 #            Bug: can screw up when the buffer contains invalid UTF-8
176 #            sequences, NUL characters, after the ring buffer lost
177 #            data, and when reading stops because the size limit is
178 #            reached.
179 #          - The return value is always Unicode regardless of format,
180 #            like any other string.
182 # Returns: data read from the device
184 # Since: 1.4
186 # Example:
188 # -> { "execute": "ringbuf-read",
189 #      "arguments": { "device": "foo",
190 #                     "size": 1000,
191 #                     "format": "utf8" } }
192 # <- { "return": "abcdefgh" }
195 { 'command': 'ringbuf-read',
196   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
197   'returns': 'str' }
200 # @ChardevCommon:
202 # Configuration shared across all chardev backends
204 # @logfile: The name of a logfile to save output
205 # @logappend: true to append instead of truncate
206 #             (default to false to truncate)
208 # Since: 2.6
210 { 'struct': 'ChardevCommon',
211   'data': { '*logfile': 'str',
212             '*logappend': 'bool' } }
215 # @ChardevFile:
217 # Configuration info for file chardevs.
219 # @in:  The name of the input file
220 # @out: The name of the output file
221 # @append: Open the file in append mode (default false to
222 #          truncate) (Since 2.6)
224 # Since: 1.4
226 { 'struct': 'ChardevFile',
227   'data': { '*in': 'str',
228             'out': 'str',
229             '*append': 'bool' },
230   'base': 'ChardevCommon' }
233 # @ChardevHostdev:
235 # Configuration info for device and pipe chardevs.
237 # @device: The name of the special file for the device,
238 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
240 # Since: 1.4
242 { 'struct': 'ChardevHostdev',
243   'data': { 'device': 'str' },
244   'base': 'ChardevCommon' }
247 # @ChardevSocket:
249 # Configuration info for (stream) socket chardevs.
251 # @addr: socket address to listen on (server=true)
252 #        or connect to (server=false)
253 # @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
257 #             and recreated on the fly while the chardev server is active.
258 #             If missing, it will default to denying access (since 4.0)
259 # @server: create server socket (default: true)
260 # @wait: wait for incoming connection on server
261 #        sockets (default: false).
262 #        Silently ignored with server: false.  This use is deprecated.
263 # @nodelay: set TCP_NODELAY socket option (default: false)
264 # @telnet: enable telnet protocol on server
265 #          sockets (default: false)
266 # @tn3270: enable tn3270 protocol on server
267 #          sockets (default: false) (Since: 2.10)
268 # @websocket: enable websocket protocol on server
269 #             sockets (default: false) (Since: 3.1)
270 # @reconnect: For a client socket, if a socket is disconnected,
271 #             then attempt a reconnect after the given number of seconds.
272 #             Setting this to zero disables this function. (default: 0)
273 #             (Since: 2.2)
275 # Since: 1.4
277 { 'struct': 'ChardevSocket',
278   'data': { 'addr': 'SocketAddressLegacy',
279             '*tls-creds': 'str',
280             '*tls-authz'  : 'str',
281             '*server': 'bool',
282             '*wait': 'bool',
283             '*nodelay': 'bool',
284             '*telnet': 'bool',
285             '*tn3270': 'bool',
286             '*websocket': 'bool',
287             '*reconnect': 'int' },
288   'base': 'ChardevCommon' }
291 # @ChardevUdp:
293 # Configuration info for datagram socket chardevs.
295 # @remote: remote address
296 # @local: local address
298 # Since: 1.5
300 { 'struct': 'ChardevUdp',
301   'data': { 'remote': 'SocketAddressLegacy',
302             '*local': 'SocketAddressLegacy' },
303   'base': 'ChardevCommon' }
306 # @ChardevMux:
308 # Configuration info for mux chardevs.
310 # @chardev: name of the base chardev.
312 # Since: 1.5
314 { 'struct': 'ChardevMux',
315   'data': { 'chardev': 'str' },
316   'base': 'ChardevCommon' }
319 # @ChardevStdio:
321 # Configuration info for stdio chardevs.
323 # @signal: Allow signals (such as SIGINT triggered by ^C)
324 #          be delivered to qemu.  Default: true.
326 # Since: 1.5
328 { 'struct': 'ChardevStdio',
329   'data': { '*signal': 'bool' },
330   'base': 'ChardevCommon' }
334 # @ChardevSpiceChannel:
336 # Configuration info for spice vm channel chardevs.
338 # @type: kind of channel (for example vdagent).
340 # Since: 1.5
342 { 'struct': 'ChardevSpiceChannel',
343   'data': { 'type': 'str' },
344   'base': 'ChardevCommon',
345   'if': 'CONFIG_SPICE' }
348 # @ChardevSpicePort:
350 # Configuration info for spice port chardevs.
352 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
354 # Since: 1.5
356 { 'struct': 'ChardevSpicePort',
357   'data': { 'fqdn': 'str' },
358   'base': 'ChardevCommon',
359   'if': 'CONFIG_SPICE' }
362 # @ChardevVC:
364 # Configuration info for virtual console chardevs.
366 # @width:  console width,  in pixels
367 # @height: console height, in pixels
368 # @cols:   console width,  in chars
369 # @rows:   console height, in chars
371 # Since: 1.5
373 { 'struct': 'ChardevVC',
374   'data': { '*width': 'int',
375             '*height': 'int',
376             '*cols': 'int',
377             '*rows': 'int' },
378   'base': 'ChardevCommon' }
381 # @ChardevRingbuf:
383 # Configuration info for ring buffer chardevs.
385 # @size: ring buffer size, must be power of two, default is 65536
387 # Since: 1.5
389 { 'struct': 'ChardevRingbuf',
390   'data': { '*size': 'int' },
391   'base': 'ChardevCommon' }
394 # @ChardevQemuVDAgent:
396 # Configuration info for qemu vdagent implementation.
398 # @mouse: enable/disable mouse, default is enabled.
399 # @clipboard: enable/disable clipboard, default is disabled.
401 # Since: 6.1
404 { 'struct': 'ChardevQemuVDAgent',
405   'data': { '*mouse': 'bool',
406             '*clipboard': 'bool' },
407   'base': 'ChardevCommon',
408   'if': 'CONFIG_SPICE_PROTOCOL' }
411 # @ChardevBackendKind:
413 # @pipe: Since 1.5
414 # @udp: Since 1.5
415 # @mux: Since 1.5
416 # @msmouse: Since 1.5
417 # @wctablet: Since 2.9
418 # @braille: Since 1.5
419 # @testdev: Since 2.2
420 # @stdio: Since 1.5
421 # @console: Since 1.5
422 # @spicevmc: Since 1.5
423 # @spiceport: Since 1.5
424 # @qemu-vdagent: Since 6.1
425 # @vc: v1.5
426 # @ringbuf: Since 1.6
427 # @memory: Since 1.5
429 # Since: 1.4
431 { 'enum': 'ChardevBackendKind',
432   'data': [ 'file',
433             'serial',
434             'parallel',
435             'pipe',
436             'socket',
437             'udp',
438             'pty',
439             'null',
440             'mux',
441             'msmouse',
442             'wctablet',
443             'braille',
444             'testdev',
445             'stdio',
446             'console',
447             { 'name': 'spicevmc', 'if': 'CONFIG_SPICE' },
448             { 'name': 'spiceport', 'if': 'CONFIG_SPICE' },
449             { 'name': 'qemu-vdagent', 'if': 'CONFIG_SPICE_PROTOCOL' },
450             'vc',
451             'ringbuf',
452             # next one is just for compatibility
453             'memory' ] }
456 # @ChardevFileWrapper:
458 # Since: 1.4
460 { 'struct': 'ChardevFileWrapper',
461   'data': { 'data': 'ChardevFile' } }
464 # @ChardevHostdevWrapper:
466 # Since: 1.4
468 { 'struct': 'ChardevHostdevWrapper',
469   'data': { 'data': 'ChardevHostdev' } }
472 # @ChardevSocketWrapper:
474 # Since: 1.4
476 { 'struct': 'ChardevSocketWrapper',
477   'data': { 'data': 'ChardevSocket' } }
480 # @ChardevUdpWrapper:
482 # Since: 1.5
484 { 'struct': 'ChardevUdpWrapper',
485   'data': { 'data': 'ChardevUdp' } }
488 # @ChardevCommonWrapper:
490 # Since: 2.6
492 { 'struct': 'ChardevCommonWrapper',
493   'data': { 'data': 'ChardevCommon' } }
496 # @ChardevMuxWrapper:
498 # Since: 1.5
500 { 'struct': 'ChardevMuxWrapper',
501   'data': { 'data': 'ChardevMux' } }
504 # @ChardevStdioWrapper:
506 # Since: 1.5
508 { 'struct': 'ChardevStdioWrapper',
509   'data': { 'data': 'ChardevStdio' } }
512 # @ChardevSpiceChannelWrapper:
514 # Since: 1.5
516 { 'struct': 'ChardevSpiceChannelWrapper',
517   'data': { 'data': 'ChardevSpiceChannel' },
518   'if': 'CONFIG_SPICE' }
521 # @ChardevSpicePortWrapper:
523 # Since: 1.5
525 { 'struct': 'ChardevSpicePortWrapper',
526   'data': { 'data': 'ChardevSpicePort' },
527   'if': 'CONFIG_SPICE' }
530 # @ChardevQemuVDAgentWrapper:
532 # Since: 6.1
534 { 'struct': 'ChardevQemuVDAgentWrapper',
535   'data': { 'data': 'ChardevQemuVDAgent' },
536   'if': 'CONFIG_SPICE_PROTOCOL' }
539 # @ChardevVCWrapper:
541 # Since: 1.5
543 { 'struct': 'ChardevVCWrapper',
544   'data': { 'data': 'ChardevVC' } }
547 # @ChardevRingbufWrapper:
549 # Since: 1.5
551 { 'struct': 'ChardevRingbufWrapper',
552   'data': { 'data': 'ChardevRingbuf' } }
555 # @ChardevBackend:
557 # Configuration info for the new chardev backend.
559 # Since: 1.4
561 { 'union': 'ChardevBackend',
562   'base': { 'type': 'ChardevBackendKind' },
563   'discriminator': 'type',
564   'data': { 'file': 'ChardevFileWrapper',
565             'serial': 'ChardevHostdevWrapper',
566             'parallel': 'ChardevHostdevWrapper',
567             'pipe': 'ChardevHostdevWrapper',
568             'socket': 'ChardevSocketWrapper',
569             'udp': 'ChardevUdpWrapper',
570             'pty': 'ChardevCommonWrapper',
571             'null': 'ChardevCommonWrapper',
572             'mux': 'ChardevMuxWrapper',
573             'msmouse': 'ChardevCommonWrapper',
574             'wctablet': 'ChardevCommonWrapper',
575             'braille': 'ChardevCommonWrapper',
576             'testdev': 'ChardevCommonWrapper',
577             'stdio': 'ChardevStdioWrapper',
578             'console': 'ChardevCommonWrapper',
579             'spicevmc': { 'type': 'ChardevSpiceChannelWrapper',
580                           'if': 'CONFIG_SPICE' },
581             'spiceport': { 'type': 'ChardevSpicePortWrapper',
582                            'if': 'CONFIG_SPICE' },
583             'qemu-vdagent': { 'type': 'ChardevQemuVDAgentWrapper',
584                               'if': 'CONFIG_SPICE_PROTOCOL' },
585             'vc': 'ChardevVCWrapper',
586             'ringbuf': 'ChardevRingbufWrapper',
587             # next one is just for compatibility
588             'memory': 'ChardevRingbufWrapper' } }
591 # @ChardevReturn:
593 # Return info about the chardev backend just created.
595 # @pty: name of the slave pseudoterminal device, present if
596 #       and only if a chardev of type 'pty' was created
598 # Since: 1.4
600 { 'struct' : 'ChardevReturn',
601   'data': { '*pty': 'str' } }
604 # @chardev-add:
606 # Add a character device backend
608 # @id: the chardev's ID, must be unique
609 # @backend: backend type and parameters
611 # Returns: ChardevReturn.
613 # Since: 1.4
615 # Example:
617 # -> { "execute" : "chardev-add",
618 #      "arguments" : { "id" : "foo",
619 #                      "backend" : { "type" : "null", "data" : {} } } }
620 # <- { "return": {} }
622 # -> { "execute" : "chardev-add",
623 #      "arguments" : { "id" : "bar",
624 #                      "backend" : { "type" : "file",
625 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
626 # <- { "return": {} }
628 # -> { "execute" : "chardev-add",
629 #      "arguments" : { "id" : "baz",
630 #                      "backend" : { "type" : "pty", "data" : {} } } }
631 # <- { "return": { "pty" : "/dev/pty/42" } }
634 { 'command': 'chardev-add',
635   'data': { 'id': 'str',
636             'backend': 'ChardevBackend' },
637   'returns': 'ChardevReturn' }
640 # @chardev-change:
642 # Change a character device backend
644 # @id: the chardev's ID, must exist
645 # @backend: new backend type and parameters
647 # Returns: ChardevReturn.
649 # Since: 2.10
651 # Example:
653 # -> { "execute" : "chardev-change",
654 #      "arguments" : { "id" : "baz",
655 #                      "backend" : { "type" : "pty", "data" : {} } } }
656 # <- { "return": { "pty" : "/dev/pty/42" } }
658 # -> {"execute" : "chardev-change",
659 #     "arguments" : {
660 #         "id" : "charchannel2",
661 #         "backend" : {
662 #             "type" : "socket",
663 #             "data" : {
664 #                 "addr" : {
665 #                     "type" : "unix" ,
666 #                     "data" : {
667 #                         "path" : "/tmp/charchannel2.socket"
668 #                     }
669 #                  },
670 #                  "server" : true,
671 #                  "wait" : false }}}}
672 # <- {"return": {}}
675 { 'command': 'chardev-change',
676   'data': { 'id': 'str',
677             'backend': 'ChardevBackend' },
678   'returns': 'ChardevReturn' }
681 # @chardev-remove:
683 # Remove a character device backend
685 # @id: the chardev's ID, must exist and not be in use
687 # Returns: Nothing on success
689 # Since: 1.4
691 # Example:
693 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
694 # <- { "return": {} }
697 { 'command': 'chardev-remove',
698   'data': { 'id': 'str' } }
701 # @chardev-send-break:
703 # Send a break to a character device
705 # @id: the chardev's ID, must exist
707 # Returns: Nothing on success
709 # Since: 2.10
711 # Example:
713 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
714 # <- { "return": {} }
717 { 'command': 'chardev-send-break',
718   'data': { 'id': 'str' } }
721 # @VSERPORT_CHANGE:
723 # Emitted when the guest opens or closes a virtio-serial port.
725 # @id: device identifier of the virtio-serial port
727 # @open: true if the guest has opened the virtio-serial port
729 # Note: This event is rate-limited.
731 # Since: 2.1
733 # Example:
735 # <- { "event": "VSERPORT_CHANGE",
736 #      "data": { "id": "channel0", "open": true },
737 #      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
740 { 'event': 'VSERPORT_CHANGE',
741   'data': { 'id': 'str',
742             'open': 'bool' } }