Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200117-1' into...
[qemu/ar7.git] / docs / interop / vhost-user.json
blobce0ef74db5a4d4baf94e2091990e1285dc2b6671
1 # -*- Mode: Python -*-
3 # Copyright (C) 2018 Red Hat, Inc.
5 # Authors:
6 #  Marc-AndrĂ© Lureau <marcandre.lureau@redhat.com>
8 # This work is licensed under the terms of the GNU GPL, version 2 or
9 # later. See the COPYING file in the top-level directory.
12 # = vhost user backend discovery & capabilities
16 # @VHostUserBackendType:
18 # List the various vhost user backend types.
20 # @9p: 9p virtio console
21 # @balloon: virtio balloon
22 # @block: virtio block
23 # @caif: virtio caif
24 # @console: virtio console
25 # @crypto: virtio crypto
26 # @gpu: virtio gpu
27 # @input: virtio input
28 # @net: virtio net
29 # @rng: virtio rng
30 # @rpmsg: virtio remote processor messaging
31 # @rproc-serial: virtio remoteproc serial link
32 # @scsi: virtio scsi
33 # @vsock: virtio vsock transport
35 # Since: 4.0
38   'enum': 'VHostUserBackendType',
39   'data': [
40       '9p',
41       'balloon',
42       'block',
43       'caif',
44       'console',
45       'crypto',
46       'gpu',
47       'input',
48       'net',
49       'rng',
50       'rpmsg',
51       'rproc-serial',
52       'scsi',
53       'vsock'
54   ]
58 # @VHostUserBackendBlockFeature:
60 # List of vhost user "block" features.
62 # @read-only: The --read-only command line option is supported.
63 # @blk-file: The --blk-file command line option is supported.
65 # Since: 5.0
68   'enum': 'VHostUserBackendBlockFeature',
69   'data': [ 'read-only', 'blk-file' ]
73 # @VHostUserBackendCapabilitiesBlock:
75 # Capabilities reported by vhost user "block" backends
77 # @features: list of supported features.
79 # Since: 5.0
82   'struct': 'VHostUserBackendCapabilitiesBlock',
83   'data': {
84     'features': [ 'VHostUserBackendBlockFeature' ]
85   }
89 # @VHostUserBackendInputFeature:
91 # List of vhost user "input" features.
93 # @evdev-path: The --evdev-path command line option is supported.
94 # @no-grab: The --no-grab command line option is supported.
96 # Since: 4.0
99   'enum': 'VHostUserBackendInputFeature',
100   'data': [ 'evdev-path', 'no-grab' ]
104 # @VHostUserBackendCapabilitiesInput:
106 # Capabilities reported by vhost user "input" backends
108 # @features: list of supported features.
110 # Since: 4.0
113   'struct': 'VHostUserBackendCapabilitiesInput',
114   'data': {
115     'features': [ 'VHostUserBackendInputFeature' ]
116   }
120 # @VHostUserBackendGPUFeature:
122 # List of vhost user "gpu" features.
124 # @render-node: The --render-node command line option is supported.
125 # @virgl: The --virgl command line option is supported.
127 # Since: 4.0
130   'enum': 'VHostUserBackendGPUFeature',
131   'data': [ 'render-node', 'virgl' ]
135 # @VHostUserBackendCapabilitiesGPU:
137 # Capabilities reported by vhost user "gpu" backends.
139 # @features: list of supported features.
141 # Since: 4.0
144   'struct': 'VHostUserBackendCapabilitiesGPU',
145   'data': {
146     'features': [ 'VHostUserBackendGPUFeature' ]
147   }
151 # @VHostUserBackendCapabilities:
153 # Capabilities reported by vhost user backends.
155 # @type: The vhost user backend type.
157 # Since: 4.0
160   'union': 'VHostUserBackendCapabilities',
161   'base': { 'type': 'VHostUserBackendType' },
162   'discriminator': 'type',
163   'data': {
164     'input': 'VHostUserBackendCapabilitiesInput',
165     'gpu': 'VHostUserBackendCapabilitiesGPU'
166   }
170 # @VhostUserBackend:
172 # Describes a vhost user backend to management software.
174 # It is possible for multiple @VhostUserBackend elements to match the
175 # search criteria of management software. Applications thus need rules
176 # to pick one of the many matches, and users need the ability to
177 # override distro defaults.
179 # It is recommended to create vhost user backend JSON files (each
180 # containing a single @VhostUserBackend root element) with a
181 # double-digit prefix, for example "50-qemu-gpu.json",
182 # "50-crosvm-gpu.json", etc, so they can be sorted in predictable
183 # order. The backend JSON files should be searched for in three
184 # directories:
186 #   - /usr/share/qemu/vhost-user -- populated by distro-provided
187 #                                   packages (XDG_DATA_DIRS covers
188 #                                   /usr/share by default),
190 #   - /etc/qemu/vhost-user -- exclusively for sysadmins' local additions,
192 #   - $XDG_CONFIG_HOME/qemu/vhost-user -- exclusively for per-user local
193 #                                         additions (XDG_CONFIG_HOME
194 #                                         defaults to $HOME/.config).
196 # Top-down, the list of directories goes from general to specific.
198 # Management software should build a list of files from all three
199 # locations, then sort the list by filename (i.e., basename
200 # component). Management software should choose the first JSON file on
201 # the sorted list that matches the search criteria. If a more specific
202 # directory has a file with same name as a less specific directory,
203 # then the file in the more specific directory takes effect. If the
204 # more specific file is zero length, it hides the less specific one.
206 # For example, if a distro ships
208 #   - /usr/share/qemu/vhost-user/50-qemu-gpu.json
210 #   - /usr/share/qemu/vhost-user/50-crosvm-gpu.json
212 # then the sysadmin can prevent the default QEMU GPU being used at all with
214 #   $ touch /etc/qemu/vhost-user/50-qemu-gpu.json
216 # The sysadmin can replace/alter the distro default QEMU GPU with
218 #   $ vim /etc/qemu/vhost-user/50-qemu-gpu.json
220 # or they can provide a parallel QEMU GPU with higher priority
222 #   $ vim /etc/qemu/vhost-user/10-qemu-gpu.json
224 # or they can provide a parallel QEMU GPU with lower priority
226 #   $ vim /etc/qemu/vhost-user/99-qemu-gpu.json
228 # @type: The vhost user backend type.
230 # @description: Provides a human-readable description of the backend.
231 #               Management software may or may not display @description.
233 # @binary: Absolute path to the backend binary.
235 # @tags: An optional list of auxiliary strings associated with the
236 #        backend for which @description is not appropriate, due to the
237 #        latter's possible exposure to the end-user. @tags serves
238 #        development and debugging purposes only, and management
239 #        software shall explicitly ignore it.
241 # Since: 4.0
243 # Example:
245 # {
246 #   "description": "QEMU vhost-user-gpu",
247 #   "type": "gpu",
248 #   "binary": "/usr/libexec/qemu/vhost-user-gpu",
249 #   "tags": [
250 #     "CONFIG_OPENGL_DMABUF=y"
251 #   ]
252 # }
256   'struct' : 'VhostUserBackend',
257   'data'   : {
258     'description': 'str',
259     'type': 'VHostUserBackendType',
260     'binary': 'str',
261     '*tags': [ 'str' ]
262   }