8 { 'include': 'sockets.json' }
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
23 # Notes: @filename is encoded using the QEMU command line character device
24 # encoding. See the QEMU man page for details.
28 { 'struct': 'ChardevInfo', 'data': {'label': 'str',
30 'frontend-open': 'bool'} }
35 # Returns information about current character devices.
37 # Returns: a list of @ChardevInfo
43 # -> { "execute": "query-chardev" }
47 # "label": "charchannel0",
48 # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
49 # "frontend-open": false
52 # "label": "charmonitor",
53 # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
54 # "frontend-open": true
57 # "label": "charserial0",
58 # "filename": "pty:/dev/pts/2",
59 # "frontend-open": true
65 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
68 # @ChardevBackendInfo:
70 # Information about a character device backend
72 # @name: The backend name
76 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
79 # @query-chardev-backends:
81 # Returns information about character device backends.
83 # Returns: a list of @ChardevBackendInfo
89 # -> { "execute": "query-chardev-backends" }
108 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
113 # An enumeration of data format.
115 # @utf8: Data is a UTF-8 string (RFC 3629)
117 # @base64: Data is Base64 encoded binary (RFC 3548)
121 { 'enum': 'DataFormat',
122 'data': [ 'utf8', 'base64' ] }
127 # Write to a ring buffer character device.
129 # @device: the ring buffer character device name
131 # @data: data to write
133 # @format: data encoding (default 'utf8').
134 # - base64: data must be base64 encoded text. Its binary
135 # decoding gets written.
136 # - utf8: data's UTF-8 encoding is written
137 # - data itself is always Unicode regardless of format, like
140 # Returns: Nothing on success
146 # -> { "execute": "ringbuf-write",
147 # "arguments": { "device": "foo",
148 # "data": "abcdefgh",
149 # "format": "utf8" } }
150 # <- { "return": {} }
153 { 'command': 'ringbuf-write',
154 'data': {'device': 'str', 'data': 'str',
155 '*format': 'DataFormat'} }
160 # Read from a ring buffer character device.
162 # @device: the ring buffer character device name
164 # @size: how many bytes to read at most
166 # @format: data encoding (default 'utf8').
167 # - base64: the data read is returned in base64 encoding.
168 # - utf8: the data read is interpreted as UTF-8.
169 # Bug: can screw up when the buffer contains invalid UTF-8
170 # sequences, NUL characters, after the ring buffer lost
171 # data, and when reading stops because the size limit is
173 # - The return value is always Unicode regardless of format,
174 # like any other string.
176 # Returns: data read from the device
182 # -> { "execute": "ringbuf-read",
183 # "arguments": { "device": "foo",
185 # "format": "utf8" } }
186 # <- { "return": "abcdefgh" }
189 { 'command': 'ringbuf-read',
190 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
196 # Configuration shared across all chardev backends
198 # @logfile: The name of a logfile to save output
199 # @logappend: true to append instead of truncate
200 # (default to false to truncate)
204 { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
205 '*logappend': 'bool' } }
210 # Configuration info for file chardevs.
212 # @in: The name of the input file
213 # @out: The name of the output file
214 # @append: Open the file in append mode (default false to
215 # truncate) (Since 2.6)
219 { 'struct': 'ChardevFile', 'data': { '*in' : 'str',
222 'base': 'ChardevCommon' }
227 # Configuration info for device and pipe chardevs.
229 # @device: The name of the special file for the device,
230 # i.e. /dev/ttyS0 on Unix or COM1: on Windows
234 { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
235 'base': 'ChardevCommon' }
240 # Configuration info for (stream) socket chardevs.
242 # @addr: socket address to listen on (server=true)
243 # or connect to (server=false)
244 # @tls-creds: the ID of the TLS credentials object (since 2.6)
245 # @server: create server socket (default: true)
246 # @wait: wait for incoming connection on server
247 # sockets (default: false).
248 # @nodelay: set TCP_NODELAY socket option (default: false)
249 # @telnet: enable telnet protocol on server
250 # sockets (default: false)
251 # @tn3270: enable tn3270 protocol on server
252 # sockets (default: false) (Since: 2.10)
253 # @reconnect: For a client socket, if a socket is disconnected,
254 # then attempt a reconnect after the given number of seconds.
255 # Setting this to zero disables this function. (default: 0)
260 { 'struct': 'ChardevSocket', 'data': { 'addr' : 'SocketAddressLegacy',
261 '*tls-creds' : 'str',
267 '*reconnect' : 'int' },
268 'base': 'ChardevCommon' }
273 # Configuration info for datagram socket chardevs.
275 # @remote: remote address
276 # @local: local address
280 { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy',
281 '*local' : 'SocketAddressLegacy' },
282 'base': 'ChardevCommon' }
287 # Configuration info for mux chardevs.
289 # @chardev: name of the base chardev.
293 { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
294 'base': 'ChardevCommon' }
299 # Configuration info for stdio chardevs.
301 # @signal: Allow signals (such as SIGINT triggered by ^C)
302 # be delivered to qemu. Default: true in -nographic mode,
307 { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
308 'base': 'ChardevCommon' }
312 # @ChardevSpiceChannel:
314 # Configuration info for spice vm channel chardevs.
316 # @type: kind of channel (for example vdagent).
320 { 'struct': 'ChardevSpiceChannel', 'data': { 'type' : 'str' },
321 'base': 'ChardevCommon' }
326 # Configuration info for spice port chardevs.
328 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
332 { 'struct': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' },
333 'base': 'ChardevCommon' }
338 # Configuration info for virtual console chardevs.
340 # @width: console width, in pixels
341 # @height: console height, in pixels
342 # @cols: console width, in chars
343 # @rows: console height, in chars
347 { 'struct': 'ChardevVC', 'data': { '*width' : 'int',
351 'base': 'ChardevCommon' }
356 # Configuration info for ring buffer chardevs.
358 # @size: ring buffer size, must be power of two, default is 65536
362 { 'struct': 'ChardevRingbuf', 'data': { '*size' : 'int' },
363 'base': 'ChardevCommon' }
368 # Configuration info for the new chardev backend.
370 # Since: 1.4 (testdev since 2.2, wctablet since 2.9)
372 { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
373 'serial' : 'ChardevHostdev',
374 'parallel': 'ChardevHostdev',
375 'pipe' : 'ChardevHostdev',
376 'socket' : 'ChardevSocket',
377 'udp' : 'ChardevUdp',
378 'pty' : 'ChardevCommon',
379 'null' : 'ChardevCommon',
380 'mux' : 'ChardevMux',
381 'msmouse': 'ChardevCommon',
382 'wctablet' : 'ChardevCommon',
383 'braille': 'ChardevCommon',
384 'testdev': 'ChardevCommon',
385 'stdio' : 'ChardevStdio',
386 'console': 'ChardevCommon',
387 'spicevmc' : 'ChardevSpiceChannel',
388 'spiceport' : 'ChardevSpicePort',
390 'ringbuf': 'ChardevRingbuf',
391 # next one is just for compatibility
392 'memory' : 'ChardevRingbuf' } }
397 # Return info about the chardev backend just created.
399 # @pty: name of the slave pseudoterminal device, present if
400 # and only if a chardev of type 'pty' was created
404 { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
409 # Add a character device backend
411 # @id: the chardev's ID, must be unique
412 # @backend: backend type and parameters
414 # Returns: ChardevReturn.
420 # -> { "execute" : "chardev-add",
421 # "arguments" : { "id" : "foo",
422 # "backend" : { "type" : "null", "data" : {} } } }
423 # <- { "return": {} }
425 # -> { "execute" : "chardev-add",
426 # "arguments" : { "id" : "bar",
427 # "backend" : { "type" : "file",
428 # "data" : { "out" : "/tmp/bar.log" } } } }
429 # <- { "return": {} }
431 # -> { "execute" : "chardev-add",
432 # "arguments" : { "id" : "baz",
433 # "backend" : { "type" : "pty", "data" : {} } } }
434 # <- { "return": { "pty" : "/dev/pty/42" } }
437 { 'command': 'chardev-add', 'data': {'id' : 'str',
438 'backend' : 'ChardevBackend' },
439 'returns': 'ChardevReturn' }
444 # Change a character device backend
446 # @id: the chardev's ID, must exist
447 # @backend: new backend type and parameters
449 # Returns: ChardevReturn.
455 # -> { "execute" : "chardev-change",
456 # "arguments" : { "id" : "baz",
457 # "backend" : { "type" : "pty", "data" : {} } } }
458 # <- { "return": { "pty" : "/dev/pty/42" } }
460 # -> {"execute" : "chardev-change",
462 # "id" : "charchannel2",
469 # "path" : "/tmp/charchannel2.socket"
473 # "wait" : false }}}}
477 { 'command': 'chardev-change', 'data': {'id' : 'str',
478 'backend' : 'ChardevBackend' },
479 'returns': 'ChardevReturn' }
484 # Remove a character device backend
486 # @id: the chardev's ID, must exist and not be in use
488 # Returns: Nothing on success
494 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
495 # <- { "return": {} }
498 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
501 # @chardev-send-break:
503 # Send a break to a character device
505 # @id: the chardev's ID, must exist
507 # Returns: Nothing on success
513 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
514 # <- { "return": {} }
517 { 'command': 'chardev-send-break', 'data': {'id': 'str'} }
522 # Emitted when the guest opens or closes a virtio-serial port.
524 # @id: device identifier of the virtio-serial port
526 # @open: true if the guest has opened the virtio-serial port
532 # <- { "event": "VSERPORT_CHANGE",
533 # "data": { "id": "channel0", "open": true },
534 # "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
537 { 'event': 'VSERPORT_CHANGE',
538 'data': { 'id': 'str', 'open': 'bool' } }