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. The use of this member is
277 # deprecated, use @reconnect-ms instead. (default: 0) (Since: 2.2)
279 # @reconnect-ms: For a client socket, if a socket is disconnected,
280 # then attempt a reconnect after the given number of milliseconds.
281 # Setting this to zero disables this function. This member is
282 # mutually exclusive with @reconnect.
283 # (default: 0) (Since: 9.2)
287 # @deprecated: Member @reconnect is deprecated. Use @reconnect-ms
292 { 'struct': 'ChardevSocket',
293 'data': { 'addr': 'SocketAddressLegacy',
295 '*tls-authz' : 'str',
301 '*websocket': 'bool',
302 '*reconnect': { 'type': 'int', 'features': [ 'deprecated' ] },
303 '*reconnect-ms': 'int' },
304 'base': 'ChardevCommon' }
309 # Configuration info for datagram socket chardevs.
311 # @remote: remote address
313 # @local: local address
317 { 'struct': 'ChardevUdp',
318 'data': { 'remote': 'SocketAddressLegacy',
319 '*local': 'SocketAddressLegacy' },
320 'base': 'ChardevCommon' }
325 # Configuration info for mux chardevs.
327 # @chardev: name of the base chardev.
331 { 'struct': 'ChardevMux',
332 'data': { 'chardev': 'str' },
333 'base': 'ChardevCommon' }
338 # Configuration info for stdio chardevs.
340 # @signal: Allow signals (such as SIGINT triggered by ^C) be delivered
341 # to qemu. Default: true.
345 { 'struct': 'ChardevStdio',
346 'data': { '*signal': 'bool' },
347 'base': 'ChardevCommon' }
350 # @ChardevSpiceChannel:
352 # Configuration info for spice vm channel chardevs.
354 # @type: kind of channel (for example vdagent).
358 { 'struct': 'ChardevSpiceChannel',
359 'data': { 'type': 'str' },
360 'base': 'ChardevCommon',
361 'if': 'CONFIG_SPICE' }
366 # Configuration info for spice port chardevs.
368 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
372 { 'struct': 'ChardevSpicePort',
373 'data': { 'fqdn': 'str' },
374 'base': 'ChardevCommon',
375 'if': 'CONFIG_SPICE' }
380 # Configuration info for DBus chardevs.
382 # @name: name of the channel (following docs/spice-port-fqdn.txt)
386 { 'struct': 'ChardevDBus',
387 'data': { 'name': 'str' },
388 'base': 'ChardevCommon',
389 'if': 'CONFIG_DBUS_DISPLAY' }
394 # Configuration info for virtual console chardevs.
396 # @width: console width, in pixels
398 # @height: console height, in pixels
400 # @cols: console width, in chars
402 # @rows: console height, in chars
404 # .. note:: The options are only effective when the VNC or SDL
405 # graphical display backend is active. They are ignored with the
406 # GTK, Spice, VNC and D-Bus display backends.
410 { 'struct': 'ChardevVC',
411 'data': { '*width': 'int',
415 'base': 'ChardevCommon' }
420 # Configuration info for ring buffer chardevs.
422 # @size: ring buffer size, must be power of two, default is 65536
426 { 'struct': 'ChardevRingbuf',
427 'data': { '*size': 'int' },
428 'base': 'ChardevCommon' }
431 # @ChardevQemuVDAgent:
433 # Configuration info for qemu vdagent implementation.
435 # @mouse: enable/disable mouse, default is enabled.
437 # @clipboard: enable/disable clipboard, default is disabled.
441 { 'struct': 'ChardevQemuVDAgent',
442 'data': { '*mouse': 'bool',
443 '*clipboard': 'bool' },
444 'base': 'ChardevCommon',
445 'if': 'CONFIG_SPICE_PROTOCOL' }
450 # Configuration info for pty implementation.
452 # @path: optional path to create a symbolic link that points to the
457 { 'struct': 'ChardevPty',
458 'data': { '*path': 'str' },
459 'base': 'ChardevCommon' }
462 # @ChardevBackendKind:
464 # @file: regular files
466 # @serial: serial host device
468 # @parallel: parallel host device
470 # @pipe: pipes (since 1.5)
472 # @socket: stream socket
474 # @udp: datagram socket (since 1.5)
476 # @pty: pseudo-terminal
478 # @null: provides no input, throws away output
482 # @msmouse: emulated Microsoft serial mouse (since 1.5)
484 # @wctablet: emulated Wacom Penpartner serial tablet (since 2.9)
486 # @braille: Baum Braille device (since 1.5)
488 # @testdev: device for test-suite control (since 2.2)
490 # @stdio: standard I/O (since 1.5)
492 # @console: Windows console (since 1.5)
494 # @spicevmc: spice vm channel (since 1.5)
496 # @spiceport: Spice port channel (since 1.5)
498 # @qemu-vdagent: Spice vdagent (since 6.1)
500 # @dbus: D-Bus channel (since 7.0)
502 # @vc: virtual console (since 1.5)
504 # @ringbuf: memory ring buffer (since 1.6)
506 # @memory: synonym for @ringbuf (since 1.5)
510 # @deprecated: Member @memory is deprecated. Use @ringbuf instead.
514 { 'enum': 'ChardevBackendKind',
516 { 'name': 'serial', 'if': 'HAVE_CHARDEV_SERIAL' },
517 { 'name': 'parallel', 'if': 'HAVE_CHARDEV_PARALLEL' },
526 { 'name': 'braille', 'if': 'CONFIG_BRLAPI' },
529 { 'name': 'console', 'if': 'CONFIG_WIN32' },
530 { 'name': 'spicevmc', 'if': 'CONFIG_SPICE' },
531 { 'name': 'spiceport', 'if': 'CONFIG_SPICE' },
532 { 'name': 'qemu-vdagent', 'if': 'CONFIG_SPICE_PROTOCOL' },
533 { 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
536 { 'name': 'memory', 'features': [ 'deprecated' ] } ] }
539 # @ChardevFileWrapper:
541 # @data: Configuration info for file chardevs
545 { 'struct': 'ChardevFileWrapper',
546 'data': { 'data': 'ChardevFile' } }
549 # @ChardevHostdevWrapper:
551 # @data: Configuration info for device and pipe chardevs
555 { 'struct': 'ChardevHostdevWrapper',
556 'data': { 'data': 'ChardevHostdev' } }
559 # @ChardevSocketWrapper:
561 # @data: Configuration info for (stream) socket chardevs
565 { 'struct': 'ChardevSocketWrapper',
566 'data': { 'data': 'ChardevSocket' } }
569 # @ChardevUdpWrapper:
571 # @data: Configuration info for datagram socket chardevs
575 { 'struct': 'ChardevUdpWrapper',
576 'data': { 'data': 'ChardevUdp' } }
579 # @ChardevCommonWrapper:
581 # @data: Configuration shared across all chardev backends
585 { 'struct': 'ChardevCommonWrapper',
586 'data': { 'data': 'ChardevCommon' } }
589 # @ChardevMuxWrapper:
591 # @data: Configuration info for mux chardevs
595 { 'struct': 'ChardevMuxWrapper',
596 'data': { 'data': 'ChardevMux' } }
599 # @ChardevStdioWrapper:
601 # @data: Configuration info for stdio chardevs
605 { 'struct': 'ChardevStdioWrapper',
606 'data': { 'data': 'ChardevStdio' } }
609 # @ChardevSpiceChannelWrapper:
611 # @data: Configuration info for spice vm channel chardevs
615 { 'struct': 'ChardevSpiceChannelWrapper',
616 'data': { 'data': 'ChardevSpiceChannel' },
617 'if': 'CONFIG_SPICE' }
620 # @ChardevSpicePortWrapper:
622 # @data: Configuration info for spice port chardevs
626 { 'struct': 'ChardevSpicePortWrapper',
627 'data': { 'data': 'ChardevSpicePort' },
628 'if': 'CONFIG_SPICE' }
631 # @ChardevQemuVDAgentWrapper:
633 # @data: Configuration info for qemu vdagent implementation
637 { 'struct': 'ChardevQemuVDAgentWrapper',
638 'data': { 'data': 'ChardevQemuVDAgent' },
639 'if': 'CONFIG_SPICE_PROTOCOL' }
642 # @ChardevDBusWrapper:
644 # @data: Configuration info for DBus chardevs
648 { 'struct': 'ChardevDBusWrapper',
649 'data': { 'data': 'ChardevDBus' },
650 'if': 'CONFIG_DBUS_DISPLAY' }
655 # @data: Configuration info for virtual console chardevs
659 { 'struct': 'ChardevVCWrapper',
660 'data': { 'data': 'ChardevVC' } }
663 # @ChardevRingbufWrapper:
665 # @data: Configuration info for ring buffer chardevs
669 { 'struct': 'ChardevRingbufWrapper',
670 'data': { 'data': 'ChardevRingbuf' } }
674 # @ChardevPtyWrapper:
676 # @data: Configuration info for pty chardevs
680 { 'struct': 'ChardevPtyWrapper',
681 'data': { 'data': 'ChardevPty' } }
686 # Configuration info for the new chardev backend.
688 # @type: backend type
692 { 'union': 'ChardevBackend',
693 'base': { 'type': 'ChardevBackendKind' },
694 'discriminator': 'type',
695 'data': { 'file': 'ChardevFileWrapper',
696 'serial': { 'type': 'ChardevHostdevWrapper',
697 'if': 'HAVE_CHARDEV_SERIAL' },
698 'parallel': { 'type': 'ChardevHostdevWrapper',
699 'if': 'HAVE_CHARDEV_PARALLEL' },
700 'pipe': 'ChardevHostdevWrapper',
701 'socket': 'ChardevSocketWrapper',
702 'udp': 'ChardevUdpWrapper',
703 'pty': 'ChardevPtyWrapper',
704 'null': 'ChardevCommonWrapper',
705 'mux': 'ChardevMuxWrapper',
706 'msmouse': 'ChardevCommonWrapper',
707 'wctablet': 'ChardevCommonWrapper',
708 'braille': { 'type': 'ChardevCommonWrapper',
709 'if': 'CONFIG_BRLAPI' },
710 'testdev': 'ChardevCommonWrapper',
711 'stdio': 'ChardevStdioWrapper',
712 'console': { 'type': 'ChardevCommonWrapper',
713 'if': 'CONFIG_WIN32' },
714 'spicevmc': { 'type': 'ChardevSpiceChannelWrapper',
715 'if': 'CONFIG_SPICE' },
716 'spiceport': { 'type': 'ChardevSpicePortWrapper',
717 'if': 'CONFIG_SPICE' },
718 'qemu-vdagent': { 'type': 'ChardevQemuVDAgentWrapper',
719 'if': 'CONFIG_SPICE_PROTOCOL' },
720 'dbus': { 'type': 'ChardevDBusWrapper',
721 'if': 'CONFIG_DBUS_DISPLAY' },
722 'vc': 'ChardevVCWrapper',
723 'ringbuf': 'ChardevRingbufWrapper',
724 'memory': 'ChardevRingbufWrapper' } }
729 # Return info about the chardev backend just created.
731 # @pty: name of the slave pseudoterminal device, present if and only
732 # if a chardev of type 'pty' was created
736 { 'struct' : 'ChardevReturn',
737 'data': { '*pty': 'str' } }
742 # Add a character device backend
744 # @id: the chardev's ID, must be unique
746 # @backend: backend type and parameters
748 # Returns: ChardevReturn.
754 # -> { "execute" : "chardev-add",
755 # "arguments" : { "id" : "foo",
756 # "backend" : { "type" : "null", "data" : {} } } }
757 # <- { "return": {} }
761 # -> { "execute" : "chardev-add",
762 # "arguments" : { "id" : "bar",
763 # "backend" : { "type" : "file",
764 # "data" : { "out" : "/tmp/bar.log" } } } }
765 # <- { "return": {} }
769 # -> { "execute" : "chardev-add",
770 # "arguments" : { "id" : "baz",
771 # "backend" : { "type" : "pty", "data" : {} } } }
772 # <- { "return": { "pty" : "/dev/pty/42" } }
774 { 'command': 'chardev-add',
775 'data': { 'id': 'str',
776 'backend': 'ChardevBackend' },
777 'returns': 'ChardevReturn' }
782 # Change a character device backend
784 # @id: the chardev's ID, must exist
786 # @backend: new backend type and parameters
788 # Returns: ChardevReturn.
794 # -> { "execute" : "chardev-change",
795 # "arguments" : { "id" : "baz",
796 # "backend" : { "type" : "pty", "data" : {} } } }
797 # <- { "return": { "pty" : "/dev/pty/42" } }
801 # -> {"execute" : "chardev-change",
803 # "id" : "charchannel2",
810 # "path" : "/tmp/charchannel2.socket"
814 # "wait" : false }}}}
817 { 'command': 'chardev-change',
818 'data': { 'id': 'str',
819 'backend': 'ChardevBackend' },
820 'returns': 'ChardevReturn' }
825 # Remove a character device backend
827 # @id: the chardev's ID, must exist and not be in use
833 # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
834 # <- { "return": {} }
836 { 'command': 'chardev-remove',
837 'data': { 'id': 'str' } }
840 # @chardev-send-break:
842 # Send a break to a character device
844 # @id: the chardev's ID, must exist
850 # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
851 # <- { "return": {} }
853 { 'command': 'chardev-send-break',
854 'data': { 'id': 'str' } }
859 # Emitted when the guest opens or closes a virtio-serial port.
861 # @id: device identifier of the virtio-serial port
863 # @open: true if the guest has opened the virtio-serial port
865 # .. note:: This event is rate-limited.
871 # <- { "event": "VSERPORT_CHANGE",
872 # "data": { "id": "channel0", "open": true },
873 # "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
875 { 'event': 'VSERPORT_CHANGE',
876 'data': { 'id': 'str',