4 # Copyright (C) 2018 Red Hat, Inc.
7 # Marc-André Lureau <marcandre.lureau@redhat.com>
9 # This work is licensed under the terms of the GNU GPL, version 2 or
10 # later. See the COPYING file in the top-level directory.
13 # = vhost user backend discovery & capabilities
17 # @VHostUserBackendType:
19 # List the various vhost user backend types.
21 # @9p: 9p virtio console
22 # @balloon: virtio balloon
23 # @block: virtio block
25 # @console: virtio console
26 # @crypto: virtio crypto
28 # @input: virtio input
31 # @rpmsg: virtio remote processor messaging
32 # @rproc-serial: virtio remoteproc serial link
34 # @vsock: virtio vsock transport
35 # @fs: virtio fs (since 4.2)
40 'enum': 'VHostUserBackendType',
61 # @VHostUserBackendBlockFeature:
63 # List of vhost user "block" features.
65 # @read-only: The --read-only command line option is supported.
66 # @blk-file: The --blk-file command line option is supported.
71 'enum': 'VHostUserBackendBlockFeature',
72 'data': [ 'read-only', 'blk-file' ]
76 # @VHostUserBackendCapabilitiesBlock:
78 # Capabilities reported by vhost user "block" backends
80 # @features: list of supported features.
85 'struct': 'VHostUserBackendCapabilitiesBlock',
87 'features': [ 'VHostUserBackendBlockFeature' ]
92 # @VHostUserBackendInputFeature:
94 # List of vhost user "input" features.
96 # @evdev-path: The --evdev-path command line option is supported.
97 # @no-grab: The --no-grab command line option is supported.
102 'enum': 'VHostUserBackendInputFeature',
103 'data': [ 'evdev-path', 'no-grab' ]
107 # @VHostUserBackendCapabilitiesInput:
109 # Capabilities reported by vhost user "input" backends
111 # @features: list of supported features.
116 'struct': 'VHostUserBackendCapabilitiesInput',
118 'features': [ 'VHostUserBackendInputFeature' ]
123 # @VHostUserBackendGPUFeature:
125 # List of vhost user "gpu" features.
127 # @render-node: The --render-node command line option is supported.
128 # @virgl: The --virgl command line option is supported.
133 'enum': 'VHostUserBackendGPUFeature',
134 'data': [ 'render-node', 'virgl' ]
138 # @VHostUserBackendCapabilitiesGPU:
140 # Capabilities reported by vhost user "gpu" backends.
142 # @features: list of supported features.
147 'struct': 'VHostUserBackendCapabilitiesGPU',
149 'features': [ 'VHostUserBackendGPUFeature' ]
154 # @VHostUserBackendCapabilities:
156 # Capabilities reported by vhost user backends.
158 # @type: The vhost user backend type.
163 'union': 'VHostUserBackendCapabilities',
164 'base': { 'type': 'VHostUserBackendType' },
165 'discriminator': 'type',
167 'input': 'VHostUserBackendCapabilitiesInput',
168 'gpu': 'VHostUserBackendCapabilitiesGPU'
175 # Describes a vhost user backend to management software.
177 # It is possible for multiple @VhostUserBackend elements to match the
178 # search criteria of management software. Applications thus need rules
179 # to pick one of the many matches, and users need the ability to
180 # override distro defaults.
182 # It is recommended to create vhost user backend JSON files (each
183 # containing a single @VhostUserBackend root element) with a
184 # double-digit prefix, for example "50-qemu-gpu.json",
185 # "50-crosvm-gpu.json", etc, so they can be sorted in predictable
186 # order. The backend JSON files should be searched for in three
189 # - /usr/share/qemu/vhost-user -- populated by distro-provided
190 # packages (XDG_DATA_DIRS covers
191 # /usr/share by default),
193 # - /etc/qemu/vhost-user -- exclusively for sysadmins' local additions,
195 # - $XDG_CONFIG_HOME/qemu/vhost-user -- exclusively for per-user local
196 # additions (XDG_CONFIG_HOME
197 # defaults to $HOME/.config).
199 # Top-down, the list of directories goes from general to specific.
201 # Management software should build a list of files from all three
202 # locations, then sort the list by filename (i.e., basename
203 # component). Management software should choose the first JSON file on
204 # the sorted list that matches the search criteria. If a more specific
205 # directory has a file with same name as a less specific directory,
206 # then the file in the more specific directory takes effect. If the
207 # more specific file is zero length, it hides the less specific one.
209 # For example, if a distro ships
211 # - /usr/share/qemu/vhost-user/50-qemu-gpu.json
213 # - /usr/share/qemu/vhost-user/50-crosvm-gpu.json
215 # then the sysadmin can prevent the default QEMU GPU being used at all with
217 # $ touch /etc/qemu/vhost-user/50-qemu-gpu.json
219 # The sysadmin can replace/alter the distro default QEMU GPU with
221 # $ vim /etc/qemu/vhost-user/50-qemu-gpu.json
223 # or they can provide a parallel QEMU GPU with higher priority
225 # $ vim /etc/qemu/vhost-user/10-qemu-gpu.json
227 # or they can provide a parallel QEMU GPU with lower priority
229 # $ vim /etc/qemu/vhost-user/99-qemu-gpu.json
231 # @type: The vhost user backend type.
233 # @description: Provides a human-readable description of the backend.
234 # Management software may or may not display @description.
236 # @binary: Absolute path to the backend binary.
238 # @tags: An optional list of auxiliary strings associated with the
239 # backend for which @description is not appropriate, due to the
240 # latter's possible exposure to the end-user. @tags serves
241 # development and debugging purposes only, and management
242 # software shall explicitly ignore it.
249 # "description": "QEMU vhost-user-gpu",
251 # "binary": "/usr/libexec/qemu/vhost-user-gpu",
260 'struct' : 'VhostUserBackend',
262 'description': 'str',
263 'type': 'VHostUserBackendType',