xref: /openbmc/qemu/qapi/char.json (revision fd4a5fd4639bb1bfd04144fca85856d825e00ab4)
1dbeee392SMarkus Armbruster# -*- Mode: Python -*-
2dbeee392SMarkus Armbruster#
3dbeee392SMarkus Armbruster
4dbeee392SMarkus Armbruster##
5dbeee392SMarkus Armbruster# = Character devices
6dbeee392SMarkus Armbruster##
7dbeee392SMarkus Armbruster
8dbeee392SMarkus Armbruster{ 'include': 'sockets.json' }
9dbeee392SMarkus Armbruster
10dbeee392SMarkus Armbruster##
11dbeee392SMarkus Armbruster# @ChardevInfo:
12dbeee392SMarkus Armbruster#
13dbeee392SMarkus Armbruster# Information about a character device.
14dbeee392SMarkus Armbruster#
15dbeee392SMarkus Armbruster# @label: the label of the character device
16dbeee392SMarkus Armbruster#
17dbeee392SMarkus Armbruster# @filename: the filename of the character device
18dbeee392SMarkus Armbruster#
19dbeee392SMarkus Armbruster# @frontend-open: shows whether the frontend device attached to this backend
20dbeee392SMarkus Armbruster#                 (eg. with the chardev=... option) is in open or closed state
21dbeee392SMarkus Armbruster#                 (since 2.1)
22dbeee392SMarkus Armbruster#
23dbeee392SMarkus Armbruster# Notes: @filename is encoded using the QEMU command line character device
24dbeee392SMarkus Armbruster#        encoding.  See the QEMU man page for details.
25dbeee392SMarkus Armbruster#
26dbeee392SMarkus Armbruster# Since: 0.14.0
27dbeee392SMarkus Armbruster##
28b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevInfo',
29b0ddeba2SMarc-André Lureau  'data': { 'label': 'str',
30dbeee392SMarkus Armbruster            'filename': 'str',
31dbeee392SMarkus Armbruster            'frontend-open': 'bool' } }
32dbeee392SMarkus Armbruster
33dbeee392SMarkus Armbruster##
34dbeee392SMarkus Armbruster# @query-chardev:
35dbeee392SMarkus Armbruster#
36dbeee392SMarkus Armbruster# Returns information about current character devices.
37dbeee392SMarkus Armbruster#
38dbeee392SMarkus Armbruster# Returns: a list of @ChardevInfo
39dbeee392SMarkus Armbruster#
40dbeee392SMarkus Armbruster# Since: 0.14.0
41dbeee392SMarkus Armbruster#
42dbeee392SMarkus Armbruster# Example:
43dbeee392SMarkus Armbruster#
44dbeee392SMarkus Armbruster# -> { "execute": "query-chardev" }
45dbeee392SMarkus Armbruster# <- {
46dbeee392SMarkus Armbruster#       "return": [
47dbeee392SMarkus Armbruster#          {
48dbeee392SMarkus Armbruster#             "label": "charchannel0",
49dbeee392SMarkus Armbruster#             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
50dbeee392SMarkus Armbruster#             "frontend-open": false
51dbeee392SMarkus Armbruster#          },
52dbeee392SMarkus Armbruster#          {
53dbeee392SMarkus Armbruster#             "label": "charmonitor",
54dbeee392SMarkus Armbruster#             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
55dbeee392SMarkus Armbruster#             "frontend-open": true
56dbeee392SMarkus Armbruster#          },
57dbeee392SMarkus Armbruster#          {
58dbeee392SMarkus Armbruster#             "label": "charserial0",
59dbeee392SMarkus Armbruster#             "filename": "pty:/dev/pts/2",
60dbeee392SMarkus Armbruster#             "frontend-open": true
61dbeee392SMarkus Armbruster#          }
62dbeee392SMarkus Armbruster#       ]
63dbeee392SMarkus Armbruster#    }
64dbeee392SMarkus Armbruster#
65dbeee392SMarkus Armbruster##
66a87706c8SIgor Mammedov{ 'command': 'query-chardev', 'returns': ['ChardevInfo'],
67a87706c8SIgor Mammedov  'allow-preconfig': true }
68dbeee392SMarkus Armbruster
69dbeee392SMarkus Armbruster##
70dbeee392SMarkus Armbruster# @ChardevBackendInfo:
71dbeee392SMarkus Armbruster#
72dbeee392SMarkus Armbruster# Information about a character device backend
73dbeee392SMarkus Armbruster#
74dbeee392SMarkus Armbruster# @name: The backend name
75dbeee392SMarkus Armbruster#
76dbeee392SMarkus Armbruster# Since: 2.0
77dbeee392SMarkus Armbruster##
78dbeee392SMarkus Armbruster{ 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
79dbeee392SMarkus Armbruster
80dbeee392SMarkus Armbruster##
81dbeee392SMarkus Armbruster# @query-chardev-backends:
82dbeee392SMarkus Armbruster#
83dbeee392SMarkus Armbruster# Returns information about character device backends.
84dbeee392SMarkus Armbruster#
85dbeee392SMarkus Armbruster# Returns: a list of @ChardevBackendInfo
86dbeee392SMarkus Armbruster#
87dbeee392SMarkus Armbruster# Since: 2.0
88dbeee392SMarkus Armbruster#
89dbeee392SMarkus Armbruster# Example:
90dbeee392SMarkus Armbruster#
91dbeee392SMarkus Armbruster# -> { "execute": "query-chardev-backends" }
92dbeee392SMarkus Armbruster# <- {
93dbeee392SMarkus Armbruster#       "return":[
94dbeee392SMarkus Armbruster#          {
95dbeee392SMarkus Armbruster#             "name":"udp"
96dbeee392SMarkus Armbruster#          },
97dbeee392SMarkus Armbruster#          {
98dbeee392SMarkus Armbruster#             "name":"tcp"
99dbeee392SMarkus Armbruster#          },
100dbeee392SMarkus Armbruster#          {
101dbeee392SMarkus Armbruster#             "name":"unix"
102dbeee392SMarkus Armbruster#          },
103dbeee392SMarkus Armbruster#          {
104dbeee392SMarkus Armbruster#             "name":"spiceport"
105dbeee392SMarkus Armbruster#          }
106dbeee392SMarkus Armbruster#       ]
107dbeee392SMarkus Armbruster#    }
108dbeee392SMarkus Armbruster#
109dbeee392SMarkus Armbruster##
110dbeee392SMarkus Armbruster{ 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
111dbeee392SMarkus Armbruster
112dbeee392SMarkus Armbruster##
113dbeee392SMarkus Armbruster# @DataFormat:
114dbeee392SMarkus Armbruster#
115dbeee392SMarkus Armbruster# An enumeration of data format.
116dbeee392SMarkus Armbruster#
117dbeee392SMarkus Armbruster# @utf8: Data is a UTF-8 string (RFC 3629)
118dbeee392SMarkus Armbruster#
119dbeee392SMarkus Armbruster# @base64: Data is Base64 encoded binary (RFC 3548)
120dbeee392SMarkus Armbruster#
121dbeee392SMarkus Armbruster# Since: 1.4
122dbeee392SMarkus Armbruster##
123dbeee392SMarkus Armbruster{ 'enum': 'DataFormat',
124dbeee392SMarkus Armbruster  'data': [ 'utf8', 'base64' ] }
125dbeee392SMarkus Armbruster
126dbeee392SMarkus Armbruster##
127dbeee392SMarkus Armbruster# @ringbuf-write:
128dbeee392SMarkus Armbruster#
129dbeee392SMarkus Armbruster# Write to a ring buffer character device.
130dbeee392SMarkus Armbruster#
131dbeee392SMarkus Armbruster# @device: the ring buffer character device name
132dbeee392SMarkus Armbruster#
133dbeee392SMarkus Armbruster# @data: data to write
134dbeee392SMarkus Armbruster#
135dbeee392SMarkus Armbruster# @format: data encoding (default 'utf8').
136dbeee392SMarkus Armbruster#          - base64: data must be base64 encoded text.  Its binary
137dbeee392SMarkus Armbruster#            decoding gets written.
138dbeee392SMarkus Armbruster#          - utf8: data's UTF-8 encoding is written
139dbeee392SMarkus Armbruster#          - data itself is always Unicode regardless of format, like
140dbeee392SMarkus Armbruster#            any other string.
141dbeee392SMarkus Armbruster#
142dbeee392SMarkus Armbruster# Returns: Nothing on success
143dbeee392SMarkus Armbruster#
144dbeee392SMarkus Armbruster# Since: 1.4
145dbeee392SMarkus Armbruster#
146dbeee392SMarkus Armbruster# Example:
147dbeee392SMarkus Armbruster#
148dbeee392SMarkus Armbruster# -> { "execute": "ringbuf-write",
149dbeee392SMarkus Armbruster#      "arguments": { "device": "foo",
150dbeee392SMarkus Armbruster#                     "data": "abcdefgh",
151dbeee392SMarkus Armbruster#                     "format": "utf8" } }
152dbeee392SMarkus Armbruster# <- { "return": {} }
153dbeee392SMarkus Armbruster#
154dbeee392SMarkus Armbruster##
155dbeee392SMarkus Armbruster{ 'command': 'ringbuf-write',
156b0ddeba2SMarc-André Lureau  'data': { 'device': 'str',
157b0ddeba2SMarc-André Lureau            'data': 'str',
158dbeee392SMarkus Armbruster           '*format': 'DataFormat'} }
159dbeee392SMarkus Armbruster
160dbeee392SMarkus Armbruster##
161dbeee392SMarkus Armbruster# @ringbuf-read:
162dbeee392SMarkus Armbruster#
163dbeee392SMarkus Armbruster# Read from a ring buffer character device.
164dbeee392SMarkus Armbruster#
165dbeee392SMarkus Armbruster# @device: the ring buffer character device name
166dbeee392SMarkus Armbruster#
167dbeee392SMarkus Armbruster# @size: how many bytes to read at most
168dbeee392SMarkus Armbruster#
169dbeee392SMarkus Armbruster# @format: data encoding (default 'utf8').
170dbeee392SMarkus Armbruster#          - base64: the data read is returned in base64 encoding.
171dbeee392SMarkus Armbruster#          - utf8: the data read is interpreted as UTF-8.
172dbeee392SMarkus Armbruster#            Bug: can screw up when the buffer contains invalid UTF-8
173dbeee392SMarkus Armbruster#            sequences, NUL characters, after the ring buffer lost
174dbeee392SMarkus Armbruster#            data, and when reading stops because the size limit is
175dbeee392SMarkus Armbruster#            reached.
176dbeee392SMarkus Armbruster#          - The return value is always Unicode regardless of format,
177dbeee392SMarkus Armbruster#            like any other string.
178dbeee392SMarkus Armbruster#
179dbeee392SMarkus Armbruster# Returns: data read from the device
180dbeee392SMarkus Armbruster#
181dbeee392SMarkus Armbruster# Since: 1.4
182dbeee392SMarkus Armbruster#
183dbeee392SMarkus Armbruster# Example:
184dbeee392SMarkus Armbruster#
185dbeee392SMarkus Armbruster# -> { "execute": "ringbuf-read",
186dbeee392SMarkus Armbruster#      "arguments": { "device": "foo",
187dbeee392SMarkus Armbruster#                     "size": 1000,
188dbeee392SMarkus Armbruster#                     "format": "utf8" } }
189dbeee392SMarkus Armbruster# <- { "return": "abcdefgh" }
190dbeee392SMarkus Armbruster#
191dbeee392SMarkus Armbruster##
192dbeee392SMarkus Armbruster{ 'command': 'ringbuf-read',
193dbeee392SMarkus Armbruster  'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
194dbeee392SMarkus Armbruster  'returns': 'str' }
195dbeee392SMarkus Armbruster
196dbeee392SMarkus Armbruster##
197dbeee392SMarkus Armbruster# @ChardevCommon:
198dbeee392SMarkus Armbruster#
199dbeee392SMarkus Armbruster# Configuration shared across all chardev backends
200dbeee392SMarkus Armbruster#
201dbeee392SMarkus Armbruster# @logfile: The name of a logfile to save output
202dbeee392SMarkus Armbruster# @logappend: true to append instead of truncate
203dbeee392SMarkus Armbruster#             (default to false to truncate)
204dbeee392SMarkus Armbruster#
205dbeee392SMarkus Armbruster# Since: 2.6
206dbeee392SMarkus Armbruster##
207b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevCommon',
208b0ddeba2SMarc-André Lureau  'data': { '*logfile': 'str',
209dbeee392SMarkus Armbruster            '*logappend': 'bool' } }
210dbeee392SMarkus Armbruster
211dbeee392SMarkus Armbruster##
212dbeee392SMarkus Armbruster# @ChardevFile:
213dbeee392SMarkus Armbruster#
214dbeee392SMarkus Armbruster# Configuration info for file chardevs.
215dbeee392SMarkus Armbruster#
216dbeee392SMarkus Armbruster# @in:  The name of the input file
217dbeee392SMarkus Armbruster# @out: The name of the output file
218dbeee392SMarkus Armbruster# @append: Open the file in append mode (default false to
219dbeee392SMarkus Armbruster#          truncate) (Since 2.6)
220dbeee392SMarkus Armbruster#
221dbeee392SMarkus Armbruster# Since: 1.4
222dbeee392SMarkus Armbruster##
223b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevFile',
224b0ddeba2SMarc-André Lureau  'data': { '*in': 'str',
225dbeee392SMarkus Armbruster            'out': 'str',
226dbeee392SMarkus Armbruster            '*append': 'bool' },
227dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
228dbeee392SMarkus Armbruster
229dbeee392SMarkus Armbruster##
230dbeee392SMarkus Armbruster# @ChardevHostdev:
231dbeee392SMarkus Armbruster#
232dbeee392SMarkus Armbruster# Configuration info for device and pipe chardevs.
233dbeee392SMarkus Armbruster#
234dbeee392SMarkus Armbruster# @device: The name of the special file for the device,
235dbeee392SMarkus Armbruster#          i.e. /dev/ttyS0 on Unix or COM1: on Windows
236dbeee392SMarkus Armbruster#
237dbeee392SMarkus Armbruster# Since: 1.4
238dbeee392SMarkus Armbruster##
239b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevHostdev',
240b0ddeba2SMarc-André Lureau  'data': { 'device': 'str' },
241dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
242dbeee392SMarkus Armbruster
243dbeee392SMarkus Armbruster##
244dbeee392SMarkus Armbruster# @ChardevSocket:
245dbeee392SMarkus Armbruster#
246dbeee392SMarkus Armbruster# Configuration info for (stream) socket chardevs.
247dbeee392SMarkus Armbruster#
248dbeee392SMarkus Armbruster# @addr: socket address to listen on (server=true)
249dbeee392SMarkus Armbruster#        or connect to (server=false)
250dbeee392SMarkus Armbruster# @tls-creds: the ID of the TLS credentials object (since 2.6)
251*fd4a5fd4SDaniel P. Berrange# @tls-authz: the ID of the QAuthZ authorization object against which
252*fd4a5fd4SDaniel P. Berrange#             the client's x509 distinguished name will be validated. This
253*fd4a5fd4SDaniel P. Berrange#             object is only resolved at time of use, so can be deleted
254*fd4a5fd4SDaniel P. Berrange#             and recreated on the fly while the chardev server is active.
255*fd4a5fd4SDaniel P. Berrange#             If missing, it will default to denying access (since 4.0)
256dbeee392SMarkus Armbruster# @server: create server socket (default: true)
257dbeee392SMarkus Armbruster# @wait: wait for incoming connection on server
258dbeee392SMarkus Armbruster#        sockets (default: false).
259dbeee392SMarkus Armbruster# @nodelay: set TCP_NODELAY socket option (default: false)
260dbeee392SMarkus Armbruster# @telnet: enable telnet protocol on server
261dbeee392SMarkus Armbruster#          sockets (default: false)
262dbeee392SMarkus Armbruster# @tn3270: enable tn3270 protocol on server
263dbeee392SMarkus Armbruster#          sockets (default: false) (Since: 2.10)
264981b06e7SJulia Suvorova# @websocket: enable websocket protocol on server
265981b06e7SJulia Suvorova#           sockets (default: false) (Since: 3.1)
266dbeee392SMarkus Armbruster# @reconnect: For a client socket, if a socket is disconnected,
267dbeee392SMarkus Armbruster#          then attempt a reconnect after the given number of seconds.
268dbeee392SMarkus Armbruster#          Setting this to zero disables this function. (default: 0)
269dbeee392SMarkus Armbruster#          (Since: 2.2)
270dbeee392SMarkus Armbruster#
271dbeee392SMarkus Armbruster# Since: 1.4
272dbeee392SMarkus Armbruster##
273b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevSocket',
274b0ddeba2SMarc-André Lureau  'data': { 'addr': 'SocketAddressLegacy',
275dbeee392SMarkus Armbruster            '*tls-creds': 'str',
276*fd4a5fd4SDaniel P. Berrange            '*tls-authz'  : 'str',
277dbeee392SMarkus Armbruster            '*server': 'bool',
278dbeee392SMarkus Armbruster            '*wait': 'bool',
279dbeee392SMarkus Armbruster            '*nodelay': 'bool',
280dbeee392SMarkus Armbruster            '*telnet': 'bool',
281dbeee392SMarkus Armbruster            '*tn3270': 'bool',
282981b06e7SJulia Suvorova            '*websocket': 'bool',
283dbeee392SMarkus Armbruster            '*reconnect': 'int' },
284dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
285dbeee392SMarkus Armbruster
286dbeee392SMarkus Armbruster##
287dbeee392SMarkus Armbruster# @ChardevUdp:
288dbeee392SMarkus Armbruster#
289dbeee392SMarkus Armbruster# Configuration info for datagram socket chardevs.
290dbeee392SMarkus Armbruster#
291dbeee392SMarkus Armbruster# @remote: remote address
292dbeee392SMarkus Armbruster# @local: local address
293dbeee392SMarkus Armbruster#
294dbeee392SMarkus Armbruster# Since: 1.5
295dbeee392SMarkus Armbruster##
296b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevUdp',
297b0ddeba2SMarc-André Lureau  'data': { 'remote': 'SocketAddressLegacy',
298dbeee392SMarkus Armbruster            '*local': 'SocketAddressLegacy' },
299dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
300dbeee392SMarkus Armbruster
301dbeee392SMarkus Armbruster##
302dbeee392SMarkus Armbruster# @ChardevMux:
303dbeee392SMarkus Armbruster#
304dbeee392SMarkus Armbruster# Configuration info for mux chardevs.
305dbeee392SMarkus Armbruster#
306dbeee392SMarkus Armbruster# @chardev: name of the base chardev.
307dbeee392SMarkus Armbruster#
308dbeee392SMarkus Armbruster# Since: 1.5
309dbeee392SMarkus Armbruster##
310b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevMux',
311b0ddeba2SMarc-André Lureau  'data': { 'chardev': 'str' },
312dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
313dbeee392SMarkus Armbruster
314dbeee392SMarkus Armbruster##
315dbeee392SMarkus Armbruster# @ChardevStdio:
316dbeee392SMarkus Armbruster#
317dbeee392SMarkus Armbruster# Configuration info for stdio chardevs.
318dbeee392SMarkus Armbruster#
319dbeee392SMarkus Armbruster# @signal: Allow signals (such as SIGINT triggered by ^C)
320dbeee392SMarkus Armbruster#          be delivered to qemu.  Default: true in -nographic mode,
321dbeee392SMarkus Armbruster#          false otherwise.
322dbeee392SMarkus Armbruster#
323dbeee392SMarkus Armbruster# Since: 1.5
324dbeee392SMarkus Armbruster##
325b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevStdio',
326b0ddeba2SMarc-André Lureau  'data': { '*signal': 'bool' },
327dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
328dbeee392SMarkus Armbruster
329dbeee392SMarkus Armbruster
330dbeee392SMarkus Armbruster##
331dbeee392SMarkus Armbruster# @ChardevSpiceChannel:
332dbeee392SMarkus Armbruster#
333dbeee392SMarkus Armbruster# Configuration info for spice vm channel chardevs.
334dbeee392SMarkus Armbruster#
335dbeee392SMarkus Armbruster# @type: kind of channel (for example vdagent).
336dbeee392SMarkus Armbruster#
337dbeee392SMarkus Armbruster# Since: 1.5
338dbeee392SMarkus Armbruster##
339b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevSpiceChannel',
340b0ddeba2SMarc-André Lureau  'data': { 'type': 'str' },
341fd9dda3bSMarc-André Lureau  'base': 'ChardevCommon',
342fd9dda3bSMarc-André Lureau  'if': 'defined(CONFIG_SPICE)' }
343dbeee392SMarkus Armbruster
344dbeee392SMarkus Armbruster##
345dbeee392SMarkus Armbruster# @ChardevSpicePort:
346dbeee392SMarkus Armbruster#
347dbeee392SMarkus Armbruster# Configuration info for spice port chardevs.
348dbeee392SMarkus Armbruster#
349dbeee392SMarkus Armbruster# @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
350dbeee392SMarkus Armbruster#
351dbeee392SMarkus Armbruster# Since: 1.5
352dbeee392SMarkus Armbruster##
353b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevSpicePort',
354b0ddeba2SMarc-André Lureau  'data': { 'fqdn': 'str' },
355fd9dda3bSMarc-André Lureau  'base': 'ChardevCommon',
356fd9dda3bSMarc-André Lureau  'if': 'defined(CONFIG_SPICE)' }
357dbeee392SMarkus Armbruster
358dbeee392SMarkus Armbruster##
359dbeee392SMarkus Armbruster# @ChardevVC:
360dbeee392SMarkus Armbruster#
361dbeee392SMarkus Armbruster# Configuration info for virtual console chardevs.
362dbeee392SMarkus Armbruster#
363dbeee392SMarkus Armbruster# @width:  console width,  in pixels
364dbeee392SMarkus Armbruster# @height: console height, in pixels
365dbeee392SMarkus Armbruster# @cols:   console width,  in chars
366dbeee392SMarkus Armbruster# @rows:   console height, in chars
367dbeee392SMarkus Armbruster#
368dbeee392SMarkus Armbruster# Since: 1.5
369dbeee392SMarkus Armbruster##
370b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevVC',
371b0ddeba2SMarc-André Lureau  'data': { '*width': 'int',
372dbeee392SMarkus Armbruster            '*height': 'int',
373dbeee392SMarkus Armbruster            '*cols': 'int',
374dbeee392SMarkus Armbruster            '*rows': 'int' },
375dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
376dbeee392SMarkus Armbruster
377dbeee392SMarkus Armbruster##
378dbeee392SMarkus Armbruster# @ChardevRingbuf:
379dbeee392SMarkus Armbruster#
380dbeee392SMarkus Armbruster# Configuration info for ring buffer chardevs.
381dbeee392SMarkus Armbruster#
382dbeee392SMarkus Armbruster# @size: ring buffer size, must be power of two, default is 65536
383dbeee392SMarkus Armbruster#
384dbeee392SMarkus Armbruster# Since: 1.5
385dbeee392SMarkus Armbruster##
386b0ddeba2SMarc-André Lureau{ 'struct': 'ChardevRingbuf',
387b0ddeba2SMarc-André Lureau  'data': { '*size': 'int' },
388dbeee392SMarkus Armbruster  'base': 'ChardevCommon' }
389dbeee392SMarkus Armbruster
390dbeee392SMarkus Armbruster##
391dbeee392SMarkus Armbruster# @ChardevBackend:
392dbeee392SMarkus Armbruster#
393dbeee392SMarkus Armbruster# Configuration info for the new chardev backend.
394dbeee392SMarkus Armbruster#
395dbeee392SMarkus Armbruster# Since: 1.4 (testdev since 2.2, wctablet since 2.9)
396dbeee392SMarkus Armbruster##
397b0ddeba2SMarc-André Lureau{ 'union': 'ChardevBackend',
398b0ddeba2SMarc-André Lureau  'data': { 'file': 'ChardevFile',
399dbeee392SMarkus Armbruster            'serial': 'ChardevHostdev',
400dbeee392SMarkus Armbruster            'parallel': 'ChardevHostdev',
401dbeee392SMarkus Armbruster            'pipe': 'ChardevHostdev',
402dbeee392SMarkus Armbruster            'socket': 'ChardevSocket',
403dbeee392SMarkus Armbruster            'udp': 'ChardevUdp',
404dbeee392SMarkus Armbruster            'pty': 'ChardevCommon',
405dbeee392SMarkus Armbruster            'null': 'ChardevCommon',
406dbeee392SMarkus Armbruster            'mux': 'ChardevMux',
407dbeee392SMarkus Armbruster            'msmouse': 'ChardevCommon',
408dbeee392SMarkus Armbruster            'wctablet': 'ChardevCommon',
409dbeee392SMarkus Armbruster            'braille': 'ChardevCommon',
410dbeee392SMarkus Armbruster            'testdev': 'ChardevCommon',
411dbeee392SMarkus Armbruster            'stdio': 'ChardevStdio',
412dbeee392SMarkus Armbruster            'console': 'ChardevCommon',
413fd9dda3bSMarc-André Lureau            'spicevmc': { 'type': 'ChardevSpiceChannel',
414fd9dda3bSMarc-André Lureau                          'if': 'defined(CONFIG_SPICE)' },
415fd9dda3bSMarc-André Lureau            'spiceport': { 'type': 'ChardevSpicePort',
416fd9dda3bSMarc-André Lureau                           'if': 'defined(CONFIG_SPICE)' },
417dbeee392SMarkus Armbruster            'vc': 'ChardevVC',
418dbeee392SMarkus Armbruster            'ringbuf': 'ChardevRingbuf',
419dbeee392SMarkus Armbruster            # next one is just for compatibility
420dbeee392SMarkus Armbruster            'memory': 'ChardevRingbuf' } }
421dbeee392SMarkus Armbruster
422dbeee392SMarkus Armbruster##
423dbeee392SMarkus Armbruster# @ChardevReturn:
424dbeee392SMarkus Armbruster#
425dbeee392SMarkus Armbruster# Return info about the chardev backend just created.
426dbeee392SMarkus Armbruster#
427dbeee392SMarkus Armbruster# @pty: name of the slave pseudoterminal device, present if
428dbeee392SMarkus Armbruster#       and only if a chardev of type 'pty' was created
429dbeee392SMarkus Armbruster#
430dbeee392SMarkus Armbruster# Since: 1.4
431dbeee392SMarkus Armbruster##
432b0ddeba2SMarc-André Lureau{ 'struct' : 'ChardevReturn',
433b0ddeba2SMarc-André Lureau  'data': { '*pty': 'str' } }
434dbeee392SMarkus Armbruster
435dbeee392SMarkus Armbruster##
436dbeee392SMarkus Armbruster# @chardev-add:
437dbeee392SMarkus Armbruster#
438dbeee392SMarkus Armbruster# Add a character device backend
439dbeee392SMarkus Armbruster#
440dbeee392SMarkus Armbruster# @id: the chardev's ID, must be unique
441dbeee392SMarkus Armbruster# @backend: backend type and parameters
442dbeee392SMarkus Armbruster#
443dbeee392SMarkus Armbruster# Returns: ChardevReturn.
444dbeee392SMarkus Armbruster#
445dbeee392SMarkus Armbruster# Since: 1.4
446dbeee392SMarkus Armbruster#
447dbeee392SMarkus Armbruster# Example:
448dbeee392SMarkus Armbruster#
449dbeee392SMarkus Armbruster# -> { "execute" : "chardev-add",
450dbeee392SMarkus Armbruster#      "arguments" : { "id" : "foo",
451dbeee392SMarkus Armbruster#                      "backend" : { "type" : "null", "data" : {} } } }
452dbeee392SMarkus Armbruster# <- { "return": {} }
453dbeee392SMarkus Armbruster#
454dbeee392SMarkus Armbruster# -> { "execute" : "chardev-add",
455dbeee392SMarkus Armbruster#      "arguments" : { "id" : "bar",
456dbeee392SMarkus Armbruster#                      "backend" : { "type" : "file",
457dbeee392SMarkus Armbruster#                                    "data" : { "out" : "/tmp/bar.log" } } } }
458dbeee392SMarkus Armbruster# <- { "return": {} }
459dbeee392SMarkus Armbruster#
460dbeee392SMarkus Armbruster# -> { "execute" : "chardev-add",
461dbeee392SMarkus Armbruster#      "arguments" : { "id" : "baz",
462dbeee392SMarkus Armbruster#                      "backend" : { "type" : "pty", "data" : {} } } }
463dbeee392SMarkus Armbruster# <- { "return": { "pty" : "/dev/pty/42" } }
464dbeee392SMarkus Armbruster#
465dbeee392SMarkus Armbruster##
466b0ddeba2SMarc-André Lureau{ 'command': 'chardev-add',
467b0ddeba2SMarc-André Lureau  'data': { 'id': 'str',
468dbeee392SMarkus Armbruster            'backend': 'ChardevBackend' },
469dbeee392SMarkus Armbruster  'returns': 'ChardevReturn' }
470dbeee392SMarkus Armbruster
471dbeee392SMarkus Armbruster##
472dbeee392SMarkus Armbruster# @chardev-change:
473dbeee392SMarkus Armbruster#
474dbeee392SMarkus Armbruster# Change a character device backend
475dbeee392SMarkus Armbruster#
476dbeee392SMarkus Armbruster# @id: the chardev's ID, must exist
477dbeee392SMarkus Armbruster# @backend: new backend type and parameters
478dbeee392SMarkus Armbruster#
479dbeee392SMarkus Armbruster# Returns: ChardevReturn.
480dbeee392SMarkus Armbruster#
481dbeee392SMarkus Armbruster# Since: 2.10
482dbeee392SMarkus Armbruster#
483dbeee392SMarkus Armbruster# Example:
484dbeee392SMarkus Armbruster#
485dbeee392SMarkus Armbruster# -> { "execute" : "chardev-change",
486dbeee392SMarkus Armbruster#      "arguments" : { "id" : "baz",
487dbeee392SMarkus Armbruster#                      "backend" : { "type" : "pty", "data" : {} } } }
488dbeee392SMarkus Armbruster# <- { "return": { "pty" : "/dev/pty/42" } }
489dbeee392SMarkus Armbruster#
490dbeee392SMarkus Armbruster# -> {"execute" : "chardev-change",
491dbeee392SMarkus Armbruster#     "arguments" : {
492dbeee392SMarkus Armbruster#         "id" : "charchannel2",
493dbeee392SMarkus Armbruster#         "backend" : {
494dbeee392SMarkus Armbruster#             "type" : "socket",
495dbeee392SMarkus Armbruster#             "data" : {
496dbeee392SMarkus Armbruster#                 "addr" : {
497dbeee392SMarkus Armbruster#                     "type" : "unix" ,
498dbeee392SMarkus Armbruster#                     "data" : {
499dbeee392SMarkus Armbruster#                         "path" : "/tmp/charchannel2.socket"
500dbeee392SMarkus Armbruster#                     }
501dbeee392SMarkus Armbruster#                  },
502dbeee392SMarkus Armbruster#                  "server" : true,
503dbeee392SMarkus Armbruster#                  "wait" : false }}}}
504dbeee392SMarkus Armbruster# <- {"return": {}}
505dbeee392SMarkus Armbruster#
506dbeee392SMarkus Armbruster##
507b0ddeba2SMarc-André Lureau{ 'command': 'chardev-change',
508b0ddeba2SMarc-André Lureau  'data': { 'id': 'str',
509dbeee392SMarkus Armbruster            'backend': 'ChardevBackend' },
510dbeee392SMarkus Armbruster  'returns': 'ChardevReturn' }
511dbeee392SMarkus Armbruster
512dbeee392SMarkus Armbruster##
513dbeee392SMarkus Armbruster# @chardev-remove:
514dbeee392SMarkus Armbruster#
515dbeee392SMarkus Armbruster# Remove a character device backend
516dbeee392SMarkus Armbruster#
517dbeee392SMarkus Armbruster# @id: the chardev's ID, must exist and not be in use
518dbeee392SMarkus Armbruster#
519dbeee392SMarkus Armbruster# Returns: Nothing on success
520dbeee392SMarkus Armbruster#
521dbeee392SMarkus Armbruster# Since: 1.4
522dbeee392SMarkus Armbruster#
523dbeee392SMarkus Armbruster# Example:
524dbeee392SMarkus Armbruster#
525dbeee392SMarkus Armbruster# -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
526dbeee392SMarkus Armbruster# <- { "return": {} }
527dbeee392SMarkus Armbruster#
528dbeee392SMarkus Armbruster##
529b0ddeba2SMarc-André Lureau{ 'command': 'chardev-remove',
530b0ddeba2SMarc-André Lureau  'data': { 'id': 'str' } }
531dbeee392SMarkus Armbruster
532dbeee392SMarkus Armbruster##
533dbeee392SMarkus Armbruster# @chardev-send-break:
534dbeee392SMarkus Armbruster#
535dbeee392SMarkus Armbruster# Send a break to a character device
536dbeee392SMarkus Armbruster#
537dbeee392SMarkus Armbruster# @id: the chardev's ID, must exist
538dbeee392SMarkus Armbruster#
539dbeee392SMarkus Armbruster# Returns: Nothing on success
540dbeee392SMarkus Armbruster#
541dbeee392SMarkus Armbruster# Since: 2.10
542dbeee392SMarkus Armbruster#
543dbeee392SMarkus Armbruster# Example:
544dbeee392SMarkus Armbruster#
545dbeee392SMarkus Armbruster# -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } }
546dbeee392SMarkus Armbruster# <- { "return": {} }
547dbeee392SMarkus Armbruster#
548dbeee392SMarkus Armbruster##
549b0ddeba2SMarc-André Lureau{ 'command': 'chardev-send-break',
550b0ddeba2SMarc-André Lureau  'data': { 'id': 'str' } }
551dbeee392SMarkus Armbruster
552dbeee392SMarkus Armbruster##
553dbeee392SMarkus Armbruster# @VSERPORT_CHANGE:
554dbeee392SMarkus Armbruster#
555dbeee392SMarkus Armbruster# Emitted when the guest opens or closes a virtio-serial port.
556dbeee392SMarkus Armbruster#
557dbeee392SMarkus Armbruster# @id: device identifier of the virtio-serial port
558dbeee392SMarkus Armbruster#
559dbeee392SMarkus Armbruster# @open: true if the guest has opened the virtio-serial port
560dbeee392SMarkus Armbruster#
561dbeee392SMarkus Armbruster# Since: 2.1
562dbeee392SMarkus Armbruster#
563dbeee392SMarkus Armbruster# Example:
564dbeee392SMarkus Armbruster#
565dbeee392SMarkus Armbruster# <- { "event": "VSERPORT_CHANGE",
566dbeee392SMarkus Armbruster#      "data": { "id": "channel0", "open": true },
567dbeee392SMarkus Armbruster#      "timestamp": { "seconds": 1401385907, "microseconds": 422329 } }
568dbeee392SMarkus Armbruster#
569dbeee392SMarkus Armbruster##
570dbeee392SMarkus Armbruster{ 'event': 'VSERPORT_CHANGE',
571b0ddeba2SMarc-André Lureau  'data': { 'id': 'str',
572b0ddeba2SMarc-André Lureau            'open': 'bool' } }
573