9 { 'include': 'sockets.json' }
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 (e.g. with the chardev=... option) is in open or closed
24 # .. note:: @filename is encoded using the QEMU command line character
25 # device encoding. See the QEMU man page for details.
29 { 'struct': 'ChardevInfo',
30 'data': { 'label': 'str',
32 'frontend-open': 'bool' } }
37 # Returns information about current character devices.
39 # Returns: a list of @ChardevInfo
45 # -> { "execute": "query-chardev" }
49 # "label": "charchannel0",
50 # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server=on",
51 # "frontend-open": false
54 # "label": "charmonitor",
55 # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server=on",
56 # "frontend-open": true
59 # "label": "charserial0",
60 # "filename": "pty:/dev/pts/2",
61 # "frontend-open": true
66 { 'command': 'query-chardev', 'returns': ['ChardevInfo'],
67 'allow-preconfig': true }
70 # @ChardevBackendInfo:
72 # Information about a character device backend
74 # @name: The backend name
78 { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
81 # @query-chardev-backends:
83 # Returns information about character device backends.
85 # Returns: a list of @ChardevBackendInfo
91 # -> { "execute": "query-chardev-backends" }
109 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
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)
122 { 'enum': 'DataFormat',
123 'data': [ 'utf8', 'base64' ] }
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
138 # - utf8: data's UTF-8 encoding is written
139 # - data itself is always Unicode regardless of format, like any
146 # -> { "execute": "ringbuf-write",
147 # "arguments": { "device": "foo",
148 # "data": "abcdefgh",
149 # "format": "utf8" } }
150 # <- { "return": {} }
152 { 'command': 'ringbuf-write',
153 'data': { 'device': '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').
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 data,
172 # and when reading stops because the size limit is reached.
173 # - The return value is always Unicode regardless of format, like
176 # Returns: data read from the device
182 # -> { "execute": "ringbuf-read",
183 # "arguments": { "device": "foo",
185 # "format": "utf8" } }
186 # <- { "return": "abcdefgh" }
188 { 'command': 'ringbuf-read',
189 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
195 # Configuration shared across all chardev backends
197 # @logfile: The name of a logfile to save output
199 # @logappend: true to append instead of truncate (default to false to
204 { 'struct': 'ChardevCommon',
205 'data': { '*logfile': 'str',
206 '*logappend': 'bool' } }
211 # Configuration info for file chardevs.
213 # @in: The name of the input file
215 # @out: The name of the output file
217 # @append: Open the file in append mode (default false to truncate)
222 { 'struct': 'ChardevFile',
223 'data': { '*in': 'str',
226 'base': 'ChardevCommon' }
231 # Configuration info for device and pipe chardevs.
233 # @device: The name of the special file for the device, i.e.
234 # /dev/ttyS0 on Unix or COM1: on Windows
238 { 'struct': 'ChardevHostdev',
239 'data': { 'device': 'str' },
240 'base': 'ChardevCommon' }
245 # Configuration info for (stream) socket chardevs.
247 # @addr: socket address to listen on (server=true) or connect to
250 # @tls-creds: the ID of the TLS credentials object (since 2.6)
252 # @tls-authz: the ID of the QAuthZ authorization object against which
253 # the client's x509 distinguished name will be validated. This
254 # object is only resolved at time of use, so can be deleted and
255 # recreated on the fly while the chardev server is active. If
256 # missing, it will default to denying access (since 4.0)
258 # @server: create server socket (default: true)
260 # @wait: wait for incoming connection on server sockets (default:
261 # false). Silently ignored with server: false. This use is
264 # @nodelay: set TCP_NODELAY socket option (default: false)
266 # @telnet: enable telnet protocol on server sockets (default: false)
268 # @tn3270: enable tn3270 protocol on server sockets (default: false)
271 # @websocket: enable websocket protocol on server sockets
272 # (default: false) (Since: 3.1)
274 # @reconnect: For a client socket, if a socket is disconnected, then
275 # attempt a reconnect after the given number of seconds. Setting
276 # this to zero disables this function. (default: 0) (Since: 2.2)
280 { 'struct': 'ChardevSocket',
281 'data': { 'addr': 'SocketAddressLegacy',
283 '*tls-authz' : 'str',
289 '*websocket': 'bool',
290 '*reconnect': 'int' },
291 'base': 'ChardevCommon' }
296 # Configuration info for datagram socket chardevs.
298 # @remote: remote address
300 # @local: local address
304 { 'struct': 'ChardevUdp',
305 'data': { 'remote': 'SocketAddressLegacy',
306 '*local': 'SocketAddressLegacy' },
307 'base': 'ChardevCommon' }
312 # Configuration info for mux chardevs.
314 # @chardev: name of the base chardev.
318 { 'struct': 'ChardevMux',
319 'data': { 'chardev': 'str' },
320 'base': 'ChardevCommon' }
325 # Configuration info for stdio chardevs.
327 # @signal: Allow signals (such as SIGINT triggered by ^C) be delivered
328 # to qemu. Default: true.
332 { 'struct': 'ChardevStdio',
333 'data': { '*signal': 'bool' },
334 'base': 'ChardevCommon' }
337 # @ChardevSpiceChannel:
339 # Configuration info for spice vm channel chardevs.
341 # @type: kind of channel (for example vdagent).
345 { 'struct': 'ChardevSpiceChannel',
346 'data': { 'type': 'str' },
347 'base': 'ChardevCommon',
348 'if': 'CONFIG_SPICE' }
353 # Configuration info for spice port chardevs.
355 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
359 { 'struct': 'ChardevSpicePort',
360 'data': { 'fqdn': 'str' },
361 'base': 'ChardevCommon',
362 'if': 'CONFIG_SPICE' }
367 # Configuration info for DBus chardevs.
369 # @name: name of the channel (following docs/spice-port-fqdn.txt)
373 { 'struct': 'ChardevDBus',
374 'data': { 'name': 'str' },
375 'base': 'ChardevCommon',
376 'if': 'CONFIG_DBUS_DISPLAY' }
381 # Configuration info for virtual console chardevs.
383 # @width: console width, in pixels
385 # @height: console height, in pixels
387 # @cols: console width, in chars
389 # @rows: console height, in chars
391 # .. note:: The options are only effective when the VNC or SDL graphical
392 # display backend is active. They are ignored with the GTK, Spice,
393 # VNC and D-Bus display backends.
397 { 'struct': 'ChardevVC',
398 'data': { '*width': 'int',
402 'base': 'ChardevCommon' }
407 # Configuration info for ring buffer chardevs.
409 # @size: ring buffer size, must be power of two, default is 65536
413 { 'struct': 'ChardevRingbuf',
414 'data': { '*size': 'int' },
415 'base': 'ChardevCommon' }
418 # @ChardevQemuVDAgent:
420 # Configuration info for qemu vdagent implementation.
422 # @mouse: enable/disable mouse, default is enabled.
424 # @clipboard: enable/disable clipboard, default is disabled.
428 { 'struct': 'ChardevQemuVDAgent',
429 'data': { '*mouse': 'bool',
430 '*clipboard': 'bool' },
431 'base': 'ChardevCommon',
432 'if': 'CONFIG_SPICE_PROTOCOL' }
435 # @ChardevBackendKind:
443 # @msmouse: Since 1.5
445 # @wctablet: Since 2.9
447 # @braille: Since 1.5
449 # @testdev: Since 2.2
453 # @console: Since 1.5
455 # @spicevmc: Since 1.5
457 # @spiceport: Since 1.5
459 # @qemu-vdagent: Since 6.1
465 # @ringbuf: Since 1.6
471 # @deprecated: Member @memory is deprecated. Use @ringbuf instead.
475 { 'enum': 'ChardevBackendKind',
477 { 'name': 'serial', 'if': 'HAVE_CHARDEV_SERIAL' },
478 { 'name': 'parallel', 'if': 'HAVE_CHARDEV_PARALLEL' },
487 { 'name': 'braille', 'if': 'CONFIG_BRLAPI' },
490 { 'name': 'console', 'if': 'CONFIG_WIN32' },
491 { 'name': 'spicevmc', 'if': 'CONFIG_SPICE' },
492 { 'name': 'spiceport', 'if': 'CONFIG_SPICE' },
493 { 'name': 'qemu-vdagent', 'if': 'CONFIG_SPICE_PROTOCOL' },
494 { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
497 { 'name': 'memory', 'features': [ 'deprecated' ] } ] }
500 # @ChardevFileWrapper:
502 # @data: Configuration info for file chardevs
506 { 'struct': 'ChardevFileWrapper',
507 'data': { 'data': 'ChardevFile' } }
510 # @ChardevHostdevWrapper:
512 # @data: Configuration info for device and pipe chardevs
516 { 'struct': 'ChardevHostdevWrapper',
517 'data': { 'data': 'ChardevHostdev' } }
520 # @ChardevSocketWrapper:
522 # @data: Configuration info for (stream) socket chardevs
526 { 'struct': 'ChardevSocketWrapper',
527 'data': { 'data': 'ChardevSocket' } }
530 # @ChardevUdpWrapper:
532 # @data: Configuration info for datagram socket chardevs
536 { 'struct': 'ChardevUdpWrapper',
537 'data': { 'data': 'ChardevUdp' } }
540 # @ChardevCommonWrapper:
542 # @data: Configuration shared across all chardev backends
546 { 'struct': 'ChardevCommonWrapper',
547 'data': { 'data': 'ChardevCommon' } }
550 # @ChardevMuxWrapper:
552 # @data: Configuration info for mux chardevs
556 { 'struct': 'ChardevMuxWrapper',
557 'data': { 'data': 'ChardevMux' } }
560 # @ChardevStdioWrapper:
562 # @data: Configuration info for stdio chardevs
566 { 'struct': 'ChardevStdioWrapper',
567 'data': { 'data': 'ChardevStdio' } }
570 # @ChardevSpiceChannelWrapper:
572 # @data: Configuration info for spice vm channel chardevs
576 { 'struct': 'ChardevSpiceChannelWrapper',
577 'data': { 'data': 'ChardevSpiceChannel' },
578 'if': 'CONFIG_SPICE' }
581 # @ChardevSpicePortWrapper:
583 # @data: Configuration info for spice port chardevs
587 { 'struct': 'ChardevSpicePortWrapper',
588 'data': { 'data': 'ChardevSpicePort' },
589 'if': 'CONFIG_SPICE' }
592 # @ChardevQemuVDAgentWrapper:
594 # @data: Configuration info for qemu vdagent implementation
598 { 'struct': 'ChardevQemuVDAgentWrapper',
599 'data': { 'data': 'ChardevQemuVDAgent' },
600 'if': 'CONFIG_SPICE_PROTOCOL' }
603 # @ChardevDBusWrapper:
605 # @data: Configuration info for DBus chardevs
609 { 'struct': 'ChardevDBusWrapper',
610 'data': { 'data': 'ChardevDBus' },
611 'if': 'CONFIG_DBUS_DISPLAY' }
616 # @data: Configuration info for virtual console chardevs
620 { 'struct': 'ChardevVCWrapper',
621 'data': { 'data': 'ChardevVC' } }
624 # @ChardevRingbufWrapper:
626 # @data: Configuration info for ring buffer chardevs
630 { 'struct': 'ChardevRingbufWrapper',
631 'data': { 'data': 'ChardevRingbuf' } }
636 # Configuration info for the new chardev backend.
638 # @type: backend type
642 { 'union': 'ChardevBackend',
643 'base': { 'type': 'ChardevBackendKind' },
644 'discriminator': 'type',
645 'data': { 'file': 'ChardevFileWrapper',
646 'serial': { 'type': 'ChardevHostdevWrapper',
647 'if': 'HAVE_CHARDEV_SERIAL' },
648 'parallel': { 'type': 'ChardevHostdevWrapper',
649 'if': 'HAVE_CHARDEV_PARALLEL' },
650 'pipe': 'ChardevHostdevWrapper',
651 'socket': 'ChardevSocketWrapper',
652 'udp': 'ChardevUdpWrapper',
653 'pty': 'ChardevCommonWrapper',
654 'null': 'ChardevCommonWrapper',
655 'mux': 'ChardevMuxWrapper',
656 'msmouse': 'ChardevCommonWrapper',
657 'wctablet': 'ChardevCommonWrapper',
658 'braille': { 'type': 'ChardevCommonWrapper',
659 'if': 'CONFIG_BRLAPI' },
660 'testdev': 'ChardevCommonWrapper',
661 'stdio': 'ChardevStdioWrapper',
662 'console': { 'type': 'ChardevCommonWrapper',
663 'if': 'CONFIG_WIN32' },
664 'spicevmc': { 'type': 'ChardevSpiceChannelWrapper',
665 'if': 'CONFIG_SPICE' },
666 'spiceport': { 'type': 'ChardevSpicePortWrapper',
667 'if': 'CONFIG_SPICE' },
668 'qemu-vdagent': { 'type': 'ChardevQemuVDAgentWrapper',
669 'if': 'CONFIG_SPICE_PROTOCOL' },
670 'dbus': { 'type': 'ChardevDBusWrapper',
671 'if': 'CONFIG_DBUS_DISPLAY' },
672 'vc': 'ChardevVCWrapper',
673 'ringbuf': 'ChardevRingbufWrapper',
674 'memory': 'ChardevRingbufWrapper' } }
679 # Return info about the chardev backend just created.
681 # @pty: name of the slave pseudoterminal device, present if and only
682 # if a chardev of type 'pty' was created
686 { 'struct' : 'ChardevReturn',
687 'data': { '*pty': 'str' } }
692 # Add a character device backend
694 # @id: the chardev's ID, must be unique
696 # @backend: backend type and parameters
698 # Returns: ChardevReturn.
704 # -> { "execute" : "chardev-add",
705 # "arguments" : { "id" : "foo",
706 # "backend" : { "type" : "null", "data" : {} } } }
707 # <- { "return": {} }
711 # -> { "execute" : "chardev-add",
712 # "arguments" : { "id" : "bar",
713 # "backend" : { "type" : "file",
714 # "data" : { "out" : "/tmp/bar.log" } } } }
715 # <- { "return": {} }
719 # -> { "execute" : "chardev-add",
720 # "arguments" : { "id" : "baz",
721 # "backend" : { "type" : "pty", "data" : {} } } }
722 # <- { "return": { "pty" : "/dev/pty/42" } }
724 { 'command': 'chardev-add',
725 'data': { 'id': 'str',
726 'backend': 'ChardevBackend' },
727 'returns': 'ChardevReturn' }
732 # Change a character device backend
734 # @id: the chardev's ID, must exist
736 # @backend: new backend type and parameters
738 # Returns: ChardevReturn.
744 # -> { "execute" : "chardev-change",
745 # "arguments" : { "id" : "baz",
746 # "backend" : { "type" : "pty", "data" : {} } } }
747 # <- { "return": { "pty" : "/dev/pty/42" } }
751 # -> {"execute" : "chardev-change",
753 # "id" : "charchannel2",
760 # "path" : "/tmp/charchannel2.socket"
764 # "wait" : false }}}}
767 { 'command': 'chardev-change',
768 'data': { 'id': 'str',
769 'backend': 'ChardevBackend' },
770 'returns': 'ChardevReturn' }
775 # Remove a character device backend
777 # @id: the chardev's ID, must exist and not be in use
783 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
784 # <- { "return": {} }
786 { 'command': 'chardev-remove',
787 'data': { 'id': 'str' } }
790 # @chardev-send-break:
792 # Send a break to a character device
794 # @id: the chardev's ID, must exist
800 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
801 # <- { "return": {} }
803 { 'command': 'chardev-send-break',
804 'data': { 'id': 'str' } }
809 # Emitted when the guest opens or closes a virtio-serial port.
811 # @id: device identifier of the virtio-serial port
813 # @open: true if the guest has opened the virtio-serial port
815 # .. note:: This event is rate-limited.
821 # <- { "event": "VSERPORT_CHANGE",
822 # "data": { "id": "channel0", "open": true },
823 # "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
825 { 'event': 'VSERPORT_CHANGE',
826 'data': { 'id': 'str',