docker: use HTTPS git URL for virglrenderer
[qemu/ar7.git] / qapi / char.json
blob79bac598a0a04693baacdc366e934ddfc1f684e6
1 # -*- Mode: Python -*-
4 ##
5 # = Character devices
6 ##
8 { 'include': 'sockets.json' }
11 # @ChardevInfo:
13 # Information about a character device.
15 # @label: the label of the character device
17 # @filename: the filename of the character device
19 # @frontend-open: shows whether the frontend device attached to this backend
20 #                 (eg. with the chardev=... option) is in open or closed state
21 #                 (since 2.1)
23 # Notes: @filename is encoded using the QEMU command line character device
24 #        encoding.  See the QEMU man page for details.
26 # Since: 0.14.0
28 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
29                                   'filename': 'str',
30                                   'frontend-open': 'bool'} }
33 # @query-chardev:
35 # Returns information about current character devices.
37 # Returns: a list of @ChardevInfo
39 # Since: 0.14.0
41 # Example:
43 # -> { "execute": "query-chardev" }
44 # <- {
45 #       "return": [
46 #          {
47 #             "label": "charchannel0",
48 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
49 #             "frontend-open": false
50 #          },
51 #          {
52 #             "label": "charmonitor",
53 #             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
54 #             "frontend-open": true
55 #          },
56 #          {
57 #             "label": "charserial0",
58 #             "filename": "pty:/dev/pts/2",
59 #             "frontend-open": true
60 #          }
61 #       ]
62 #    }
65 { 'command': 'query-chardev', 'returns': ['ChardevInfo'],
66   'allow-preconfig': true }
69 # @ChardevBackendInfo:
71 # Information about a character device backend
73 # @name: The backend name
75 # Since: 2.0
77 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
80 # @query-chardev-backends:
82 # Returns information about character device backends.
84 # Returns: a list of @ChardevBackendInfo
86 # Since: 2.0
88 # Example:
90 # -> { "execute": "query-chardev-backends" }
91 # <- {
92 #       "return":[
93 #          {
94 #             "name":"udp"
95 #          },
96 #          {
97 #             "name":"tcp"
98 #          },
99 #          {
100 #             "name":"unix"
101 #          },
102 #          {
103 #             "name":"spiceport"
104 #          }
105 #       ]
106 #    }
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').
135 #          - base64: data must be base64 encoded text.  Its binary
136 #            decoding gets written.
137 #          - utf8: data's UTF-8 encoding is written
138 #          - data itself is always Unicode regardless of format, like
139 #            any other string.
141 # Returns: Nothing on success
143 # Since: 1.4
145 # Example:
147 # -> { "execute": "ringbuf-write",
148 #      "arguments": { "device": "foo",
149 #                     "data": "abcdefgh",
150 #                     "format": "utf8" } }
151 # <- { "return": {} }
154 { 'command': 'ringbuf-write',
155   'data': {'device': 'str', 'data': 'str',
156            '*format': 'DataFormat'} }
159 # @ringbuf-read:
161 # Read from a ring buffer character device.
163 # @device: the ring buffer character device name
165 # @size: how many bytes to read at most
167 # @format: data encoding (default 'utf8').
168 #          - base64: the data read is returned in base64 encoding.
169 #          - utf8: the data read is interpreted as UTF-8.
170 #            Bug: can screw up when the buffer contains invalid UTF-8
171 #            sequences, NUL characters, after the ring buffer lost
172 #            data, and when reading stops because the size limit is
173 #            reached.
174 #          - The return value is always Unicode regardless of format,
175 #            like any other string.
177 # Returns: data read from the device
179 # Since: 1.4
181 # Example:
183 # -> { "execute": "ringbuf-read",
184 #      "arguments": { "device": "foo",
185 #                     "size": 1000,
186 #                     "format": "utf8" } }
187 # <- { "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
200 # @logappend: true to append instead of truncate
201 #             (default to false to truncate)
203 # Since: 2.6
205 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
206                                        '*logappend': 'bool' } }
209 # @ChardevFile:
211 # Configuration info for file chardevs.
213 # @in:  The name of the input file
214 # @out: The name of the output file
215 # @append: Open the file in append mode (default false to
216 #          truncate) (Since 2.6)
218 # Since: 1.4
220 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
221                                    'out' : 'str',
222                                    '*append': 'bool' },
223   'base': 'ChardevCommon' }
226 # @ChardevHostdev:
228 # Configuration info for device and pipe chardevs.
230 # @device: The name of the special file for the device,
231 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
233 # Since: 1.4
235 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
236   'base': 'ChardevCommon' }
239 # @ChardevSocket:
241 # Configuration info for (stream) socket chardevs.
243 # @addr: socket address to listen on (server=true)
244 #        or connect to (server=false)
245 # @tls-creds: the ID of the TLS credentials object (since 2.6)
246 # @server: create server socket (default: true)
247 # @wait: wait for incoming connection on server
248 #        sockets (default: false).
249 # @nodelay: set TCP_NODELAY socket option (default: false)
250 # @telnet: enable telnet protocol on server
251 #          sockets (default: false)
252 # @tn3270: enable tn3270 protocol on server
253 #          sockets (default: false) (Since: 2.10)
254 # @websocket: enable websocket protocol on server
255 #           sockets (default: false) (Since: 3.1)
256 # @reconnect: For a client socket, if a socket is disconnected,
257 #          then attempt a reconnect after the given number of seconds.
258 #          Setting this to zero disables this function. (default: 0)
259 #          (Since: 2.2)
261 # Since: 1.4
263 { 'struct': 'ChardevSocket', 'data': { 'addr'       : 'SocketAddressLegacy',
264                                      '*tls-creds'  : 'str',
265                                      '*server'    : 'bool',
266                                      '*wait'      : 'bool',
267                                      '*nodelay'   : 'bool',
268                                      '*telnet'    : 'bool',
269                                      '*tn3270'    : 'bool',
270                                      '*websocket' : 'bool',
271                                      '*reconnect' : 'int' },
272   'base': 'ChardevCommon' }
275 # @ChardevUdp:
277 # Configuration info for datagram socket chardevs.
279 # @remote: remote address
280 # @local: local address
282 # Since: 1.5
284 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy',
285                                   '*local' : 'SocketAddressLegacy' },
286   'base': 'ChardevCommon' }
289 # @ChardevMux:
291 # Configuration info for mux chardevs.
293 # @chardev: name of the base chardev.
295 # Since: 1.5
297 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
298   'base': 'ChardevCommon' }
301 # @ChardevStdio:
303 # Configuration info for stdio chardevs.
305 # @signal: Allow signals (such as SIGINT triggered by ^C)
306 #          be delivered to qemu.  Default: true in -nographic mode,
307 #          false otherwise.
309 # Since: 1.5
311 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
312   'base': 'ChardevCommon' }
316 # @ChardevSpiceChannel:
318 # Configuration info for spice vm channel chardevs.
320 # @type: kind of channel (for example vdagent).
322 # Since: 1.5
324 { 'struct': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' },
325   'base': 'ChardevCommon' }
326 # TODO: 'if': 'defined(CONFIG_SPICE)'
329 # @ChardevSpicePort:
331 # Configuration info for spice port chardevs.
333 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
335 # Since: 1.5
337 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' },
338   'base': 'ChardevCommon' }
339 # TODO: 'if': 'defined(CONFIG_SPICE)'
342 # @ChardevVC:
344 # Configuration info for virtual console chardevs.
346 # @width:  console width,  in pixels
347 # @height: console height, in pixels
348 # @cols:   console width,  in chars
349 # @rows:   console height, in chars
351 # Since: 1.5
353 { 'struct': 'ChardevVC', 'data': { '*width'  : 'int',
354                                  '*height' : 'int',
355                                  '*cols'   : 'int',
356                                  '*rows'   : 'int' },
357   'base': 'ChardevCommon' }
360 # @ChardevRingbuf:
362 # Configuration info for ring buffer chardevs.
364 # @size: ring buffer size, must be power of two, default is 65536
366 # Since: 1.5
368 { 'struct': 'ChardevRingbuf', 'data': { '*size'  : 'int' },
369   'base': 'ChardevCommon' }
372 # @ChardevBackend:
374 # Configuration info for the new chardev backend.
376 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
378 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
379                                        'serial' : 'ChardevHostdev',
380                                        'parallel': 'ChardevHostdev',
381                                        'pipe'   : 'ChardevHostdev',
382                                        'socket' : 'ChardevSocket',
383                                        'udp'    : 'ChardevUdp',
384                                        'pty'    : 'ChardevCommon',
385                                        'null'   : 'ChardevCommon',
386                                        'mux'    : 'ChardevMux',
387                                        'msmouse': 'ChardevCommon',
388                                        'wctablet' : 'ChardevCommon',
389                                        'braille': 'ChardevCommon',
390                                        'testdev': 'ChardevCommon',
391                                        'stdio'  : 'ChardevStdio',
392                                        'console': 'ChardevCommon',
393                                        'spicevmc': 'ChardevSpiceChannel',
394 # TODO: { 'type': 'ChardevSpiceChannel', 'if': 'defined(CONFIG_SPICE)' },
395                                        'spiceport': 'ChardevSpicePort',
396 # TODO: { 'type': 'ChardevSpicePort', 'if': 'defined(CONFIG_SPICE)' },
397                                        'vc'     : 'ChardevVC',
398                                        'ringbuf': 'ChardevRingbuf',
399                                        # next one is just for compatibility
400                                        'memory' : 'ChardevRingbuf' } }
403 # @ChardevReturn:
405 # Return info about the chardev backend just created.
407 # @pty: name of the slave pseudoterminal device, present if
408 #       and only if a chardev of type 'pty' was created
410 # Since: 1.4
412 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
415 # @chardev-add:
417 # Add a character device backend
419 # @id: the chardev's ID, must be unique
420 # @backend: backend type and parameters
422 # Returns: ChardevReturn.
424 # Since: 1.4
426 # Example:
428 # -> { "execute" : "chardev-add",
429 #      "arguments" : { "id" : "foo",
430 #                      "backend" : { "type" : "null", "data" : {} } } }
431 # <- { "return": {} }
433 # -> { "execute" : "chardev-add",
434 #      "arguments" : { "id" : "bar",
435 #                      "backend" : { "type" : "file",
436 #                                    "data" : { "out" : "/tmp/bar.log" } } } }
437 # <- { "return": {} }
439 # -> { "execute" : "chardev-add",
440 #      "arguments" : { "id" : "baz",
441 #                      "backend" : { "type" : "pty", "data" : {} } } }
442 # <- { "return": { "pty" : "/dev/pty/42" } }
445 { 'command': 'chardev-add', 'data': {'id'      : 'str',
446                                      'backend' : 'ChardevBackend' },
447   'returns': 'ChardevReturn' }
450 # @chardev-change:
452 # Change a character device backend
454 # @id: the chardev's ID, must exist
455 # @backend: new backend type and parameters
457 # Returns: ChardevReturn.
459 # Since: 2.10
461 # Example:
463 # -> { "execute" : "chardev-change",
464 #      "arguments" : { "id" : "baz",
465 #                      "backend" : { "type" : "pty", "data" : {} } } }
466 # <- { "return": { "pty" : "/dev/pty/42" } }
468 # -> {"execute" : "chardev-change",
469 #     "arguments" : {
470 #         "id" : "charchannel2",
471 #         "backend" : {
472 #             "type" : "socket",
473 #             "data" : {
474 #                 "addr" : {
475 #                     "type" : "unix" ,
476 #                     "data" : {
477 #                         "path" : "/tmp/charchannel2.socket"
478 #                     }
479 #                  },
480 #                  "server" : true,
481 #                  "wait" : false }}}}
482 # <- {"return": {}}
485 { 'command': 'chardev-change', 'data': {'id'      : 'str',
486                                         'backend' : 'ChardevBackend' },
487   'returns': 'ChardevReturn' }
490 # @chardev-remove:
492 # Remove a character device backend
494 # @id: the chardev's ID, must exist and not be in use
496 # Returns: Nothing on success
498 # Since: 1.4
500 # Example:
502 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
503 # <- { "return": {} }
506 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
509 # @chardev-send-break:
511 # Send a break to a character device
513 # @id: the chardev's ID, must exist
515 # Returns: Nothing on success
517 # Since: 2.10
519 # Example:
521 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
522 # <- { "return": {} }
525 { 'command': 'chardev-send-break', 'data': {'id': 'str'} }
528 # @VSERPORT_CHANGE:
530 # Emitted when the guest opens or closes a virtio-serial port.
532 # @id: device identifier of the virtio-serial port
534 # @open: true if the guest has opened the virtio-serial port
536 # Since: 2.1
538 # Example:
540 # <- { "event": "VSERPORT_CHANGE",
541 #      "data": { "id": "channel0", "open": true },
542 #      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
545 { 'event': 'VSERPORT_CHANGE',
546   'data': { 'id': 'str', 'open': 'bool' } }