2017-08-24 22:13:58 +03:00
|
|
|
# -*- Mode: Python -*-
|
2020-07-29 21:50:24 +03:00
|
|
|
# vim: filetype=python
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
##
|
|
|
|
# = Character devices
|
|
|
|
##
|
|
|
|
|
|
|
|
{ 'include': 'sockets.json' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevInfo:
|
|
|
|
#
|
|
|
|
# Information about a character device.
|
|
|
|
#
|
|
|
|
# @label: the label of the character device
|
|
|
|
#
|
|
|
|
# @filename: the filename of the character device
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @frontend-open: shows whether the frontend device attached to this
|
2023-07-20 10:16:08 +03:00
|
|
|
# backend (e.g. with the chardev=... option) is in open or closed
|
2023-04-28 13:54:29 +03:00
|
|
|
# state (since 2.1)
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# Notes: @filename is encoded using the QEMU command line character
|
|
|
|
# device encoding. See the QEMU man page for details.
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 0.14
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevInfo',
|
|
|
|
'data': { 'label': 'str',
|
|
|
|
'filename': 'str',
|
|
|
|
'frontend-open': 'bool' } }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @query-chardev:
|
|
|
|
#
|
|
|
|
# Returns information about current character devices.
|
|
|
|
#
|
|
|
|
# Returns: a list of @ChardevInfo
|
|
|
|
#
|
2020-11-18 09:41:58 +03:00
|
|
|
# Since: 0.14
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "query-chardev" }
|
|
|
|
# <- {
|
|
|
|
# "return": [
|
|
|
|
# {
|
|
|
|
# "label": "charchannel0",
|
|
|
|
# "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server=on",
|
|
|
|
# "frontend-open": false
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "label": "charmonitor",
|
|
|
|
# "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server=on",
|
|
|
|
# "frontend-open": true
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "label": "charserial0",
|
|
|
|
# "filename": "pty:/dev/pts/2",
|
|
|
|
# "frontend-open": true
|
|
|
|
# }
|
|
|
|
# ]
|
|
|
|
# }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
2018-06-20 18:39:44 +03:00
|
|
|
{ 'command': 'query-chardev', 'returns': ['ChardevInfo'],
|
|
|
|
'allow-preconfig': true }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevBackendInfo:
|
|
|
|
#
|
|
|
|
# Information about a character device backend
|
|
|
|
#
|
|
|
|
# @name: The backend name
|
|
|
|
#
|
|
|
|
# Since: 2.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @query-chardev-backends:
|
|
|
|
#
|
|
|
|
# Returns information about character device backends.
|
|
|
|
#
|
|
|
|
# Returns: a list of @ChardevBackendInfo
|
|
|
|
#
|
|
|
|
# Since: 2.0
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "query-chardev-backends" }
|
|
|
|
# <- {
|
|
|
|
# "return":[
|
|
|
|
# {
|
|
|
|
# "name":"udp"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name":"tcp"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name":"unix"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name":"spiceport"
|
|
|
|
# }
|
|
|
|
# ]
|
|
|
|
# }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @DataFormat:
|
|
|
|
#
|
|
|
|
# An enumeration of data format.
|
|
|
|
#
|
|
|
|
# @utf8: Data is a UTF-8 string (RFC 3629)
|
|
|
|
#
|
|
|
|
# @base64: Data is Base64 encoded binary (RFC 3548)
|
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
##
|
|
|
|
{ 'enum': 'DataFormat',
|
|
|
|
'data': [ 'utf8', 'base64' ] }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ringbuf-write:
|
|
|
|
#
|
|
|
|
# Write to a ring buffer character device.
|
|
|
|
#
|
|
|
|
# @device: the ring buffer character device name
|
|
|
|
#
|
|
|
|
# @data: data to write
|
|
|
|
#
|
|
|
|
# @format: data encoding (default 'utf8').
|
2020-02-13 20:56:33 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# - base64: data must be base64 encoded text. Its binary decoding
|
|
|
|
# gets written.
|
|
|
|
# - utf8: data's UTF-8 encoding is written
|
|
|
|
# - data itself is always Unicode regardless of format, like any
|
|
|
|
# other string.
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "ringbuf-write",
|
|
|
|
# "arguments": { "device": "foo",
|
|
|
|
# "data": "abcdefgh",
|
|
|
|
# "format": "utf8" } }
|
|
|
|
# <- { "return": {} }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'ringbuf-write',
|
2018-12-08 14:16:04 +03:00
|
|
|
'data': { 'device': 'str',
|
|
|
|
'data': 'str',
|
2017-08-24 22:13:58 +03:00
|
|
|
'*format': 'DataFormat'} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ringbuf-read:
|
|
|
|
#
|
|
|
|
# Read from a ring buffer character device.
|
|
|
|
#
|
|
|
|
# @device: the ring buffer character device name
|
|
|
|
#
|
|
|
|
# @size: how many bytes to read at most
|
|
|
|
#
|
|
|
|
# @format: data encoding (default 'utf8').
|
2020-02-13 20:56:33 +03:00
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# - base64: the data read is returned in base64 encoding.
|
|
|
|
# - utf8: the data read is interpreted as UTF-8.
|
|
|
|
# Bug: can screw up when the buffer contains invalid UTF-8
|
|
|
|
# sequences, NUL characters, after the ring buffer lost data,
|
|
|
|
# and when reading stops because the size limit is reached.
|
|
|
|
# - The return value is always Unicode regardless of format, like
|
|
|
|
# any other string.
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Returns: data read from the device
|
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "ringbuf-read",
|
|
|
|
# "arguments": { "device": "foo",
|
|
|
|
# "size": 1000,
|
|
|
|
# "format": "utf8" } }
|
|
|
|
# <- { "return": "abcdefgh" }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
|
|
|
{ 'command': 'ringbuf-read',
|
|
|
|
'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
|
|
|
|
'returns': 'str' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevCommon:
|
|
|
|
#
|
|
|
|
# Configuration shared across all chardev backends
|
|
|
|
#
|
|
|
|
# @logfile: The name of a logfile to save output
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
|
|
|
# @logappend: true to append instead of truncate (default to false to
|
|
|
|
# truncate)
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Since: 2.6
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevCommon',
|
|
|
|
'data': { '*logfile': 'str',
|
|
|
|
'*logappend': 'bool' } }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevFile:
|
|
|
|
#
|
|
|
|
# Configuration info for file chardevs.
|
|
|
|
#
|
2022-05-03 10:37:35 +03:00
|
|
|
# @in: The name of the input file
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @out: The name of the output file
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
|
|
|
# @append: Open the file in append mode (default false to truncate)
|
|
|
|
# (Since 2.6)
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevFile',
|
|
|
|
'data': { '*in': 'str',
|
|
|
|
'out': 'str',
|
|
|
|
'*append': 'bool' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevHostdev:
|
|
|
|
#
|
|
|
|
# Configuration info for device and pipe chardevs.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @device: The name of the special file for the device, i.e.
|
|
|
|
# /dev/ttyS0 on Unix or COM1: on Windows
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevHostdev',
|
|
|
|
'data': { 'device': 'str' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevSocket:
|
|
|
|
#
|
|
|
|
# Configuration info for (stream) socket chardevs.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @addr: socket address to listen on (server=true) or connect to
|
|
|
|
# (server=false)
|
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @tls-creds: the ID of the TLS credentials object (since 2.6)
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
chardev: add support for authorization for TLS clients
Currently any client which can complete the TLS handshake is able to use
a chardev server. The server admin can turn on the 'verify-peer' option
for the x509 creds to require the client to provide a x509
certificate. This means the client will have to acquire a certificate
from the CA before they are permitted to use the chardev server. This is
still a fairly low bar.
This adds a 'tls-authz=OBJECT-ID' option to the socket chardev backend
which takes the ID of a previously added 'QAuthZ' object instance. This
will be used to validate the client's x509 distinguished name. Clients
failing the check will not be permitted to use the chardev server.
For example to setup authorization that only allows connection from a
client whose x509 certificate distinguished name contains 'CN=fred', you
would use:
$QEMU -object tls-creds-x509,id=tls0,dir=/home/berrange/qemutls,\
endpoint=server,verify-peer=yes \
-object authz-simple,id=authz0,identity=CN=laptop.example.com,,\
O=Example Org,,L=London,,ST=London,,C=GB \
-chardev socket,host=127.0.0.1,port=9000,server,\
tls-creds=tls0,tls-authz=authz0 \
...other qemu args...
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-03-08 18:21:50 +03:00
|
|
|
# @tls-authz: the ID of the QAuthZ authorization object against which
|
2023-04-28 13:54:29 +03:00
|
|
|
# the client's x509 distinguished name will be validated. This
|
|
|
|
# object is only resolved at time of use, so can be deleted and
|
|
|
|
# recreated on the fly while the chardev server is active. If
|
|
|
|
# missing, it will default to denying access (since 4.0)
|
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @server: create server socket (default: true)
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
|
|
|
# @wait: wait for incoming connection on server sockets (default:
|
|
|
|
# false). Silently ignored with server: false. This use is
|
|
|
|
# deprecated.
|
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @nodelay: set TCP_NODELAY socket option (default: false)
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
|
|
|
# @telnet: enable telnet protocol on server sockets (default: false)
|
|
|
|
#
|
|
|
|
# @tn3270: enable tn3270 protocol on server sockets (default: false)
|
|
|
|
# (Since: 2.10)
|
|
|
|
#
|
|
|
|
# @websocket: enable websocket protocol on server sockets
|
|
|
|
# (default: false) (Since: 3.1)
|
|
|
|
#
|
|
|
|
# @reconnect: For a client socket, if a socket is disconnected, then
|
|
|
|
# attempt a reconnect after the given number of seconds. Setting
|
|
|
|
# this to zero disables this function. (default: 0) (Since: 2.2)
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevSocket',
|
|
|
|
'data': { 'addr': 'SocketAddressLegacy',
|
|
|
|
'*tls-creds': 'str',
|
chardev: add support for authorization for TLS clients
Currently any client which can complete the TLS handshake is able to use
a chardev server. The server admin can turn on the 'verify-peer' option
for the x509 creds to require the client to provide a x509
certificate. This means the client will have to acquire a certificate
from the CA before they are permitted to use the chardev server. This is
still a fairly low bar.
This adds a 'tls-authz=OBJECT-ID' option to the socket chardev backend
which takes the ID of a previously added 'QAuthZ' object instance. This
will be used to validate the client's x509 distinguished name. Clients
failing the check will not be permitted to use the chardev server.
For example to setup authorization that only allows connection from a
client whose x509 certificate distinguished name contains 'CN=fred', you
would use:
$QEMU -object tls-creds-x509,id=tls0,dir=/home/berrange/qemutls,\
endpoint=server,verify-peer=yes \
-object authz-simple,id=authz0,identity=CN=laptop.example.com,,\
O=Example Org,,L=London,,ST=London,,C=GB \
-chardev socket,host=127.0.0.1,port=9000,server,\
tls-creds=tls0,tls-authz=authz0 \
...other qemu args...
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-03-08 18:21:50 +03:00
|
|
|
'*tls-authz' : 'str',
|
2018-12-08 14:16:04 +03:00
|
|
|
'*server': 'bool',
|
|
|
|
'*wait': 'bool',
|
|
|
|
'*nodelay': 'bool',
|
|
|
|
'*telnet': 'bool',
|
|
|
|
'*tn3270': 'bool',
|
|
|
|
'*websocket': 'bool',
|
|
|
|
'*reconnect': 'int' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevUdp:
|
|
|
|
#
|
|
|
|
# Configuration info for datagram socket chardevs.
|
|
|
|
#
|
|
|
|
# @remote: remote address
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @local: local address
|
|
|
|
#
|
|
|
|
# Since: 1.5
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevUdp',
|
|
|
|
'data': { 'remote': 'SocketAddressLegacy',
|
|
|
|
'*local': 'SocketAddressLegacy' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevMux:
|
|
|
|
#
|
|
|
|
# Configuration info for mux chardevs.
|
|
|
|
#
|
|
|
|
# @chardev: name of the base chardev.
|
|
|
|
#
|
|
|
|
# Since: 1.5
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevMux',
|
|
|
|
'data': { 'chardev': 'str' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevStdio:
|
|
|
|
#
|
|
|
|
# Configuration info for stdio chardevs.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @signal: Allow signals (such as SIGINT triggered by ^C) be delivered
|
|
|
|
# to qemu. Default: true.
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Since: 1.5
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevStdio',
|
|
|
|
'data': { '*signal': 'bool' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevSpiceChannel:
|
|
|
|
#
|
|
|
|
# Configuration info for spice vm channel chardevs.
|
|
|
|
#
|
|
|
|
# @type: kind of channel (for example vdagent).
|
|
|
|
#
|
|
|
|
# Since: 1.5
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevSpiceChannel',
|
|
|
|
'data': { 'type': 'str' },
|
2018-12-13 15:37:23 +03:00
|
|
|
'base': 'ChardevCommon',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'CONFIG_SPICE' }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevSpicePort:
|
|
|
|
#
|
|
|
|
# Configuration info for spice port chardevs.
|
|
|
|
#
|
|
|
|
# @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
|
|
|
|
#
|
|
|
|
# Since: 1.5
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevSpicePort',
|
|
|
|
'data': { 'fqdn': 'str' },
|
2018-12-13 15:37:23 +03:00
|
|
|
'base': 'ChardevCommon',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'CONFIG_SPICE' }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
2021-07-22 18:43:29 +03:00
|
|
|
##
|
|
|
|
# @ChardevDBus:
|
|
|
|
#
|
|
|
|
# Configuration info for DBus chardevs.
|
|
|
|
#
|
|
|
|
# @name: name of the channel (following docs/spice-port-fqdn.txt)
|
|
|
|
#
|
|
|
|
# Since: 7.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevDBus',
|
|
|
|
'data': { 'name': 'str' },
|
|
|
|
'base': 'ChardevCommon',
|
|
|
|
'if': 'CONFIG_DBUS_DISPLAY' }
|
|
|
|
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
|
|
|
# @ChardevVC:
|
|
|
|
#
|
|
|
|
# Configuration info for virtual console chardevs.
|
|
|
|
#
|
2022-05-03 10:37:36 +03:00
|
|
|
# @width: console width, in pixels
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @height: console height, in pixels
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2022-05-03 10:37:36 +03:00
|
|
|
# @cols: console width, in chars
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2022-05-03 10:37:36 +03:00
|
|
|
# @rows: console height, in chars
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
2023-08-30 12:38:17 +03:00
|
|
|
# Note: the options are only effective when the VNC or SDL graphical
|
2024-01-20 12:53:26 +03:00
|
|
|
# display backend is active. They are ignored with the GTK,
|
|
|
|
# Spice, VNC and D-Bus display backends.
|
2023-08-30 12:38:17 +03:00
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevVC',
|
|
|
|
'data': { '*width': 'int',
|
|
|
|
'*height': 'int',
|
|
|
|
'*cols': 'int',
|
|
|
|
'*rows': 'int' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevRingbuf:
|
|
|
|
#
|
|
|
|
# Configuration info for ring buffer chardevs.
|
|
|
|
#
|
|
|
|
# @size: ring buffer size, must be power of two, default is 65536
|
|
|
|
#
|
|
|
|
# Since: 1.5
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct': 'ChardevRingbuf',
|
|
|
|
'data': { '*size': 'int' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'base': 'ChardevCommon' }
|
|
|
|
|
2021-05-19 08:39:35 +03:00
|
|
|
##
|
|
|
|
# @ChardevQemuVDAgent:
|
|
|
|
#
|
|
|
|
# Configuration info for qemu vdagent implementation.
|
|
|
|
#
|
2021-05-19 08:39:36 +03:00
|
|
|
# @mouse: enable/disable mouse, default is enabled.
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-05-19 08:39:37 +03:00
|
|
|
# @clipboard: enable/disable clipboard, default is disabled.
|
2021-05-19 08:39:36 +03:00
|
|
|
#
|
2021-05-19 08:39:35 +03:00
|
|
|
# Since: 6.1
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevQemuVDAgent',
|
2021-05-19 08:39:37 +03:00
|
|
|
'data': { '*mouse': 'bool',
|
|
|
|
'*clipboard': 'bool' },
|
2021-05-19 08:39:35 +03:00
|
|
|
'base': 'ChardevCommon',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'CONFIG_SPICE_PROTOCOL' }
|
2021-05-19 08:39:35 +03:00
|
|
|
|
2021-09-17 17:31:18 +03:00
|
|
|
##
|
|
|
|
# @ChardevBackendKind:
|
|
|
|
#
|
|
|
|
# @pipe: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @udp: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @mux: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @msmouse: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @wctablet: Since 2.9
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @braille: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @testdev: Since 2.2
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @stdio: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @console: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @spicevmc: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @spiceport: Since 1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @qemu-vdagent: Since 6.1
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-07-22 18:43:29 +03:00
|
|
|
# @dbus: Since 7.0
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @vc: v1.5
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @ringbuf: Since 1.6
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# @memory: Since 1.5
|
|
|
|
#
|
2024-02-03 11:02:28 +03:00
|
|
|
# Features:
|
|
|
|
#
|
|
|
|
# @deprecated: Member @memory is deprecated. Use @ringbuf instead.
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.4
|
|
|
|
##
|
|
|
|
{ 'enum': 'ChardevBackendKind',
|
|
|
|
'data': [ 'file',
|
2024-02-03 11:02:27 +03:00
|
|
|
{ 'name': 'serial', 'if': 'HAVE_CHARDEV_SERIAL' },
|
|
|
|
{ 'name': 'parallel', 'if': 'HAVE_CHARDEV_PARALLEL' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'pipe',
|
|
|
|
'socket',
|
|
|
|
'udp',
|
|
|
|
'pty',
|
|
|
|
'null',
|
|
|
|
'mux',
|
|
|
|
'msmouse',
|
|
|
|
'wctablet',
|
2024-02-03 11:02:27 +03:00
|
|
|
{ 'name': 'braille', 'if': 'CONFIG_BRLAPI' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'testdev',
|
|
|
|
'stdio',
|
2024-02-03 11:02:27 +03:00
|
|
|
{ 'name': 'console', 'if': 'CONFIG_WIN32' },
|
2021-09-17 17:31:18 +03:00
|
|
|
{ 'name': 'spicevmc', 'if': 'CONFIG_SPICE' },
|
|
|
|
{ 'name': 'spiceport', 'if': 'CONFIG_SPICE' },
|
|
|
|
{ 'name': 'qemu-vdagent', 'if': 'CONFIG_SPICE_PROTOCOL' },
|
2021-07-22 18:43:29 +03:00
|
|
|
{ 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'vc',
|
|
|
|
'ringbuf',
|
2024-02-03 11:02:28 +03:00
|
|
|
{ 'name': 'memory', 'features': [ 'deprecated' ] } ] }
|
2021-09-17 17:31:18 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevFileWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for file chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.4
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevFileWrapper',
|
|
|
|
'data': { 'data': 'ChardevFile' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevHostdevWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for device and pipe chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.4
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevHostdevWrapper',
|
|
|
|
'data': { 'data': 'ChardevHostdev' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevSocketWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for (stream) socket chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.4
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevSocketWrapper',
|
|
|
|
'data': { 'data': 'ChardevSocket' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevUdpWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for datagram socket chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevUdpWrapper',
|
|
|
|
'data': { 'data': 'ChardevUdp' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevCommonWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration shared across all chardev backends
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 2.6
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevCommonWrapper',
|
|
|
|
'data': { 'data': 'ChardevCommon' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevMuxWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for mux chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevMuxWrapper',
|
|
|
|
'data': { 'data': 'ChardevMux' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevStdioWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for stdio chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevStdioWrapper',
|
|
|
|
'data': { 'data': 'ChardevStdio' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevSpiceChannelWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for spice vm channel chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevSpiceChannelWrapper',
|
|
|
|
'data': { 'data': 'ChardevSpiceChannel' },
|
|
|
|
'if': 'CONFIG_SPICE' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevSpicePortWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for spice port chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevSpicePortWrapper',
|
|
|
|
'data': { 'data': 'ChardevSpicePort' },
|
|
|
|
'if': 'CONFIG_SPICE' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevQemuVDAgentWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for qemu vdagent implementation
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 6.1
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevQemuVDAgentWrapper',
|
|
|
|
'data': { 'data': 'ChardevQemuVDAgent' },
|
|
|
|
'if': 'CONFIG_SPICE_PROTOCOL' }
|
|
|
|
|
2021-07-22 18:43:29 +03:00
|
|
|
##
|
|
|
|
# @ChardevDBusWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for DBus chardevs
|
|
|
|
#
|
2021-07-22 18:43:29 +03:00
|
|
|
# Since: 7.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevDBusWrapper',
|
|
|
|
'data': { 'data': 'ChardevDBus' },
|
|
|
|
'if': 'CONFIG_DBUS_DISPLAY' }
|
|
|
|
|
2021-09-17 17:31:18 +03:00
|
|
|
##
|
|
|
|
# @ChardevVCWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for virtual console chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevVCWrapper',
|
|
|
|
'data': { 'data': 'ChardevVC' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevRingbufWrapper:
|
|
|
|
#
|
2024-02-05 10:47:06 +03:00
|
|
|
# @data: Configuration info for ring buffer chardevs
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.5
|
|
|
|
##
|
|
|
|
{ 'struct': 'ChardevRingbufWrapper',
|
|
|
|
'data': { 'data': 'ChardevRingbuf' } }
|
|
|
|
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
|
|
|
# @ChardevBackend:
|
|
|
|
#
|
|
|
|
# Configuration info for the new chardev backend.
|
|
|
|
#
|
2024-02-05 10:47:09 +03:00
|
|
|
# @type: backend type
|
|
|
|
#
|
2021-09-17 17:31:18 +03:00
|
|
|
# Since: 1.4
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'union': 'ChardevBackend',
|
2021-09-17 17:31:18 +03:00
|
|
|
'base': { 'type': 'ChardevBackendKind' },
|
|
|
|
'discriminator': 'type',
|
|
|
|
'data': { 'file': 'ChardevFileWrapper',
|
2024-02-03 11:02:27 +03:00
|
|
|
'serial': { 'type': 'ChardevHostdevWrapper',
|
|
|
|
'if': 'HAVE_CHARDEV_SERIAL' },
|
|
|
|
'parallel': { 'type': 'ChardevHostdevWrapper',
|
|
|
|
'if': 'HAVE_CHARDEV_PARALLEL' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'pipe': 'ChardevHostdevWrapper',
|
|
|
|
'socket': 'ChardevSocketWrapper',
|
|
|
|
'udp': 'ChardevUdpWrapper',
|
|
|
|
'pty': 'ChardevCommonWrapper',
|
|
|
|
'null': 'ChardevCommonWrapper',
|
|
|
|
'mux': 'ChardevMuxWrapper',
|
|
|
|
'msmouse': 'ChardevCommonWrapper',
|
|
|
|
'wctablet': 'ChardevCommonWrapper',
|
2024-02-03 11:02:27 +03:00
|
|
|
'braille': { 'type': 'ChardevCommonWrapper',
|
|
|
|
'if': 'CONFIG_BRLAPI' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'testdev': 'ChardevCommonWrapper',
|
|
|
|
'stdio': 'ChardevStdioWrapper',
|
2024-02-03 11:02:27 +03:00
|
|
|
'console': { 'type': 'ChardevCommonWrapper',
|
|
|
|
'if': 'CONFIG_WIN32' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'spicevmc': { 'type': 'ChardevSpiceChannelWrapper',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'CONFIG_SPICE' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'spiceport': { 'type': 'ChardevSpicePortWrapper',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'CONFIG_SPICE' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'qemu-vdagent': { 'type': 'ChardevQemuVDAgentWrapper',
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'CONFIG_SPICE_PROTOCOL' },
|
2021-07-22 18:43:29 +03:00
|
|
|
'dbus': { 'type': 'ChardevDBusWrapper',
|
|
|
|
'if': 'CONFIG_DBUS_DISPLAY' },
|
2021-09-17 17:31:18 +03:00
|
|
|
'vc': 'ChardevVCWrapper',
|
|
|
|
'ringbuf': 'ChardevRingbufWrapper',
|
|
|
|
'memory': 'ChardevRingbufWrapper' } }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @ChardevReturn:
|
|
|
|
#
|
|
|
|
# Return info about the chardev backend just created.
|
|
|
|
#
|
2023-04-28 13:54:29 +03:00
|
|
|
# @pty: name of the slave pseudoterminal device, present if and only
|
|
|
|
# if a chardev of type 'pty' was created
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'struct' : 'ChardevReturn',
|
|
|
|
'data': { '*pty': 'str' } }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @chardev-add:
|
|
|
|
#
|
|
|
|
# Add a character device backend
|
|
|
|
#
|
|
|
|
# @id: the chardev's ID, must be unique
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @backend: backend type and parameters
|
|
|
|
#
|
|
|
|
# Returns: ChardevReturn.
|
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
#
|
2023-04-25 09:42:14 +03:00
|
|
|
# Examples:
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute" : "chardev-add",
|
|
|
|
# "arguments" : { "id" : "foo",
|
|
|
|
# "backend" : { "type" : "null", "data" : {} } } }
|
|
|
|
# <- { "return": {} }
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute" : "chardev-add",
|
|
|
|
# "arguments" : { "id" : "bar",
|
|
|
|
# "backend" : { "type" : "file",
|
|
|
|
# "data" : { "out" : "/tmp/bar.log" } } } }
|
|
|
|
# <- { "return": {} }
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute" : "chardev-add",
|
|
|
|
# "arguments" : { "id" : "baz",
|
|
|
|
# "backend" : { "type" : "pty", "data" : {} } } }
|
|
|
|
# <- { "return": { "pty" : "/dev/pty/42" } }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'command': 'chardev-add',
|
|
|
|
'data': { 'id': 'str',
|
|
|
|
'backend': 'ChardevBackend' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'returns': 'ChardevReturn' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @chardev-change:
|
|
|
|
#
|
|
|
|
# Change a character device backend
|
|
|
|
#
|
|
|
|
# @id: the chardev's ID, must exist
|
2023-04-28 13:54:29 +03:00
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# @backend: new backend type and parameters
|
|
|
|
#
|
|
|
|
# Returns: ChardevReturn.
|
|
|
|
#
|
|
|
|
# Since: 2.10
|
|
|
|
#
|
2023-04-25 09:42:14 +03:00
|
|
|
# Examples:
|
2017-08-24 22:13:58 +03:00
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute" : "chardev-change",
|
|
|
|
# "arguments" : { "id" : "baz",
|
|
|
|
# "backend" : { "type" : "pty", "data" : {} } } }
|
|
|
|
# <- { "return": { "pty" : "/dev/pty/42" } }
|
|
|
|
#
|
|
|
|
# -> {"execute" : "chardev-change",
|
|
|
|
# "arguments" : {
|
|
|
|
# "id" : "charchannel2",
|
|
|
|
# "backend" : {
|
|
|
|
# "type" : "socket",
|
|
|
|
# "data" : {
|
|
|
|
# "addr" : {
|
|
|
|
# "type" : "unix" ,
|
|
|
|
# "data" : {
|
|
|
|
# "path" : "/tmp/charchannel2.socket"
|
|
|
|
# }
|
|
|
|
# },
|
|
|
|
# "server" : true,
|
|
|
|
# "wait" : false }}}}
|
|
|
|
# <- {"return": {}}
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'command': 'chardev-change',
|
|
|
|
'data': { 'id': 'str',
|
|
|
|
'backend': 'ChardevBackend' },
|
2017-08-24 22:13:58 +03:00
|
|
|
'returns': 'ChardevReturn' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @chardev-remove:
|
|
|
|
#
|
|
|
|
# Remove a character device backend
|
|
|
|
#
|
|
|
|
# @id: the chardev's ID, must exist and not be in use
|
|
|
|
#
|
|
|
|
# Since: 1.4
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
|
|
|
|
# <- { "return": {} }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'command': 'chardev-remove',
|
|
|
|
'data': { 'id': 'str' } }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @chardev-send-break:
|
|
|
|
#
|
|
|
|
# Send a break to a character device
|
|
|
|
#
|
|
|
|
# @id: the chardev's ID, must exist
|
|
|
|
#
|
|
|
|
# Since: 2.10
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
|
|
|
|
# <- { "return": {} }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
2018-12-08 14:16:04 +03:00
|
|
|
{ 'command': 'chardev-send-break',
|
|
|
|
'data': { 'id': 'str' } }
|
2017-08-24 22:13:58 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @VSERPORT_CHANGE:
|
|
|
|
#
|
|
|
|
# Emitted when the guest opens or closes a virtio-serial port.
|
|
|
|
#
|
|
|
|
# @id: device identifier of the virtio-serial port
|
|
|
|
#
|
|
|
|
# @open: true if the guest has opened the virtio-serial port
|
|
|
|
#
|
2020-08-06 11:11:46 +03:00
|
|
|
# Note: This event is rate-limited.
|
|
|
|
#
|
2017-08-24 22:13:58 +03:00
|
|
|
# Since: 2.1
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2024-02-16 17:58:34 +03:00
|
|
|
# <- { "event": "VSERPORT_CHANGE",
|
|
|
|
# "data": { "id": "channel0", "open": true },
|
|
|
|
# "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
|
2017-08-24 22:13:58 +03:00
|
|
|
##
|
|
|
|
{ 'event': 'VSERPORT_CHANGE',
|
2018-12-08 14:16:04 +03:00
|
|
|
'data': { 'id': 'str',
|
|
|
|
'open': 'bool' } }
|