target/riscv: Enable the Hypervisor extension by default
[qemu/ar7.git] / qapi / char.json
blob7b421515751b7a0ddca8b61efc3834ee8f55ffe1
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 # @ChardevDBus:
364 # Configuration info for DBus chardevs.
366 # @name: name of the channel (following docs/spice-port-fqdn.txt)
368 # Since: 7.0
370 { 'struct': 'ChardevDBus',
371   'data': { 'name': 'str' },
372   'base': 'ChardevCommon',
373   'if': 'CONFIG_DBUS_DISPLAY' }
376 # @ChardevVC:
378 # Configuration info for virtual console chardevs.
380 # @width:  console width,  in pixels
381 # @height: console height, in pixels
382 # @cols:   console width,  in chars
383 # @rows:   console height, in chars
385 # Since: 1.5
387 { 'struct': 'ChardevVC',
388   'data': { '*width': 'int',
389             '*height': 'int',
390             '*cols': 'int',
391             '*rows': 'int' },
392   'base': 'ChardevCommon' }
395 # @ChardevRingbuf:
397 # Configuration info for ring buffer chardevs.
399 # @size: ring buffer size, must be power of two, default is 65536
401 # Since: 1.5
403 { 'struct': 'ChardevRingbuf',
404   'data': { '*size': 'int' },
405   'base': 'ChardevCommon' }
408 # @ChardevQemuVDAgent:
410 # Configuration info for qemu vdagent implementation.
412 # @mouse: enable/disable mouse, default is enabled.
413 # @clipboard: enable/disable clipboard, default is disabled.
415 # Since: 6.1
418 { 'struct': 'ChardevQemuVDAgent',
419   'data': { '*mouse': 'bool',
420             '*clipboard': 'bool' },
421   'base': 'ChardevCommon',
422   'if': 'CONFIG_SPICE_PROTOCOL' }
425 # @ChardevBackendKind:
427 # @pipe: Since 1.5
428 # @udp: Since 1.5
429 # @mux: Since 1.5
430 # @msmouse: Since 1.5
431 # @wctablet: Since 2.9
432 # @braille: Since 1.5
433 # @testdev: Since 2.2
434 # @stdio: Since 1.5
435 # @console: Since 1.5
436 # @spicevmc: Since 1.5
437 # @spiceport: Since 1.5
438 # @qemu-vdagent: Since 6.1
439 # @dbus: Since 7.0
440 # @vc: v1.5
441 # @ringbuf: Since 1.6
442 # @memory: Since 1.5
444 # Since: 1.4
446 { 'enum': 'ChardevBackendKind',
447   'data': [ 'file',
448             'serial',
449             'parallel',
450             'pipe',
451             'socket',
452             'udp',
453             'pty',
454             'null',
455             'mux',
456             'msmouse',
457             'wctablet',
458             'braille',
459             'testdev',
460             'stdio',
461             'console',
462             { 'name': 'spicevmc', 'if': 'CONFIG_SPICE' },
463             { 'name': 'spiceport', 'if': 'CONFIG_SPICE' },
464             { 'name': 'qemu-vdagent', 'if': 'CONFIG_SPICE_PROTOCOL' },
465             { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
466             'vc',
467             'ringbuf',
468             # next one is just for compatibility
469             'memory' ] }
472 # @ChardevFileWrapper:
474 # Since: 1.4
476 { 'struct': 'ChardevFileWrapper',
477   'data': { 'data': 'ChardevFile' } }
480 # @ChardevHostdevWrapper:
482 # Since: 1.4
484 { 'struct': 'ChardevHostdevWrapper',
485   'data': { 'data': 'ChardevHostdev' } }
488 # @ChardevSocketWrapper:
490 # Since: 1.4
492 { 'struct': 'ChardevSocketWrapper',
493   'data': { 'data': 'ChardevSocket' } }
496 # @ChardevUdpWrapper:
498 # Since: 1.5
500 { 'struct': 'ChardevUdpWrapper',
501   'data': { 'data': 'ChardevUdp' } }
504 # @ChardevCommonWrapper:
506 # Since: 2.6
508 { 'struct': 'ChardevCommonWrapper',
509   'data': { 'data': 'ChardevCommon' } }
512 # @ChardevMuxWrapper:
514 # Since: 1.5
516 { 'struct': 'ChardevMuxWrapper',
517   'data': { 'data': 'ChardevMux' } }
520 # @ChardevStdioWrapper:
522 # Since: 1.5
524 { 'struct': 'ChardevStdioWrapper',
525   'data': { 'data': 'ChardevStdio' } }
528 # @ChardevSpiceChannelWrapper:
530 # Since: 1.5
532 { 'struct': 'ChardevSpiceChannelWrapper',
533   'data': { 'data': 'ChardevSpiceChannel' },
534   'if': 'CONFIG_SPICE' }
537 # @ChardevSpicePortWrapper:
539 # Since: 1.5
541 { 'struct': 'ChardevSpicePortWrapper',
542   'data': { 'data': 'ChardevSpicePort' },
543   'if': 'CONFIG_SPICE' }
546 # @ChardevQemuVDAgentWrapper:
548 # Since: 6.1
550 { 'struct': 'ChardevQemuVDAgentWrapper',
551   'data': { 'data': 'ChardevQemuVDAgent' },
552   'if': 'CONFIG_SPICE_PROTOCOL' }
555 # @ChardevDBusWrapper:
557 # Since: 7.0
559 { 'struct': 'ChardevDBusWrapper',
560   'data': { 'data': 'ChardevDBus' },
561   'if': 'CONFIG_DBUS_DISPLAY' }
564 # @ChardevVCWrapper:
566 # Since: 1.5
568 { 'struct': 'ChardevVCWrapper',
569   'data': { 'data': 'ChardevVC' } }
572 # @ChardevRingbufWrapper:
574 # Since: 1.5
576 { 'struct': 'ChardevRingbufWrapper',
577   'data': { 'data': 'ChardevRingbuf' } }
580 # @ChardevBackend:
582 # Configuration info for the new chardev backend.
584 # Since: 1.4
586 { 'union': 'ChardevBackend',
587   'base': { 'type': 'ChardevBackendKind' },
588   'discriminator': 'type',
589   'data': { 'file': 'ChardevFileWrapper',
590             'serial': 'ChardevHostdevWrapper',
591             'parallel': 'ChardevHostdevWrapper',
592             'pipe': 'ChardevHostdevWrapper',
593             'socket': 'ChardevSocketWrapper',
594             'udp': 'ChardevUdpWrapper',
595             'pty': 'ChardevCommonWrapper',
596             'null': 'ChardevCommonWrapper',
597             'mux': 'ChardevMuxWrapper',
598             'msmouse': 'ChardevCommonWrapper',
599             'wctablet': 'ChardevCommonWrapper',
600             'braille': 'ChardevCommonWrapper',
601             'testdev': 'ChardevCommonWrapper',
602             'stdio': 'ChardevStdioWrapper',
603             'console': 'ChardevCommonWrapper',
604             'spicevmc': { 'type': 'ChardevSpiceChannelWrapper',
605                           'if': 'CONFIG_SPICE' },
606             'spiceport': { 'type': 'ChardevSpicePortWrapper',
607                            'if': 'CONFIG_SPICE' },
608             'qemu-vdagent': { 'type': 'ChardevQemuVDAgentWrapper',
609                               'if': 'CONFIG_SPICE_PROTOCOL' },
610             'dbus': { 'type': 'ChardevDBusWrapper',
611                       'if': 'CONFIG_DBUS_DISPLAY' },
612             'vc': 'ChardevVCWrapper',
613             'ringbuf': 'ChardevRingbufWrapper',
614             # next one is just for compatibility
615             'memory': 'ChardevRingbufWrapper' } }
618 # @ChardevReturn:
620 # Return info about the chardev backend just created.
622 # @pty: name of the slave pseudoterminal device, present if
623 #       and only if a chardev of type 'pty' was created
625 # Since: 1.4
627 { 'struct' : 'ChardevReturn',
628   'data': { '*pty': 'str' } }
631 # @chardev-add:
633 # Add a character device backend
635 # @id: the chardev's ID, must be unique
636 # @backend: backend type and parameters
638 # Returns: ChardevReturn.
640 # Since: 1.4
642 # Example:
644 # -> { "execute" : "chardev-add",
645 #      "arguments" : { "id" : "foo",
646 #                      "backend" : { "type" : "null", "data" : {} } } }
647 # <- { "return": {} }
649 # -> { "execute" : "chardev-add",
650 #      "arguments" : { "id" : "bar",
651 #                      "backend" : { "type" : "file",
652 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
653 # <- { "return": {} }
655 # -> { "execute" : "chardev-add",
656 #      "arguments" : { "id" : "baz",
657 #                      "backend" : { "type" : "pty", "data" : {} } } }
658 # <- { "return": { "pty" : "/dev/pty/42" } }
661 { 'command': 'chardev-add',
662   'data': { 'id': 'str',
663             'backend': 'ChardevBackend' },
664   'returns': 'ChardevReturn' }
667 # @chardev-change:
669 # Change a character device backend
671 # @id: the chardev's ID, must exist
672 # @backend: new backend type and parameters
674 # Returns: ChardevReturn.
676 # Since: 2.10
678 # Example:
680 # -> { "execute" : "chardev-change",
681 #      "arguments" : { "id" : "baz",
682 #                      "backend" : { "type" : "pty", "data" : {} } } }
683 # <- { "return": { "pty" : "/dev/pty/42" } }
685 # -> {"execute" : "chardev-change",
686 #     "arguments" : {
687 #         "id" : "charchannel2",
688 #         "backend" : {
689 #             "type" : "socket",
690 #             "data" : {
691 #                 "addr" : {
692 #                     "type" : "unix" ,
693 #                     "data" : {
694 #                         "path" : "/tmp/charchannel2.socket"
695 #                     }
696 #                  },
697 #                  "server" : true,
698 #                  "wait" : false }}}}
699 # <- {"return": {}}
702 { 'command': 'chardev-change',
703   'data': { 'id': 'str',
704             'backend': 'ChardevBackend' },
705   'returns': 'ChardevReturn' }
708 # @chardev-remove:
710 # Remove a character device backend
712 # @id: the chardev's ID, must exist and not be in use
714 # Returns: Nothing on success
716 # Since: 1.4
718 # Example:
720 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
721 # <- { "return": {} }
724 { 'command': 'chardev-remove',
725   'data': { 'id': 'str' } }
728 # @chardev-send-break:
730 # Send a break to a character device
732 # @id: the chardev's ID, must exist
734 # Returns: Nothing on success
736 # Since: 2.10
738 # Example:
740 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
741 # <- { "return": {} }
744 { 'command': 'chardev-send-break',
745   'data': { 'id': 'str' } }
748 # @VSERPORT_CHANGE:
750 # Emitted when the guest opens or closes a virtio-serial port.
752 # @id: device identifier of the virtio-serial port
754 # @open: true if the guest has opened the virtio-serial port
756 # Note: This event is rate-limited.
758 # Since: 2.1
760 # Example:
762 # <- { "event": "VSERPORT_CHANGE",
763 #      "data": { "id": "channel0", "open": true },
764 #      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
767 { 'event': 'VSERPORT_CHANGE',
768   'data': { 'id': 'str',
769             'open': 'bool' } }