3 # Copyright (C) 2018 Red Hat, Inc.
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
24 # @console: virtio console
25 # @crypto: virtio crypto
27 # @input: virtio input
30 # @rpmsg: virtio remote processor messaging
31 # @rproc-serial: virtio remoteproc serial link
33 # @vsock: virtio vsock transport
34 # @fs: virtio fs (since 4.2)
39 'enum': 'VHostUserBackendType',
60 # @VHostUserBackendBlockFeature:
62 # List of vhost user "block" features.
64 # @read-only: The --read-only command line option is supported.
65 # @blk-file: The --blk-file command line option is supported.
70 'enum': 'VHostUserBackendBlockFeature',
71 'data': [ 'read-only', 'blk-file' ]
75 # @VHostUserBackendCapabilitiesBlock:
77 # Capabilities reported by vhost user "block" backends
79 # @features: list of supported features.
84 'struct': 'VHostUserBackendCapabilitiesBlock',
86 'features': [ 'VHostUserBackendBlockFeature' ]
91 # @VHostUserBackendInputFeature:
93 # List of vhost user "input" features.
95 # @evdev-path: The --evdev-path command line option is supported.
96 # @no-grab: The --no-grab command line option is supported.
101 'enum': 'VHostUserBackendInputFeature',
102 'data': [ 'evdev-path', 'no-grab' ]
106 # @VHostUserBackendCapabilitiesInput:
108 # Capabilities reported by vhost user "input" backends
110 # @features: list of supported features.
115 'struct': 'VHostUserBackendCapabilitiesInput',
117 'features': [ 'VHostUserBackendInputFeature' ]
122 # @VHostUserBackendGPUFeature:
124 # List of vhost user "gpu" features.
126 # @render-node: The --render-node command line option is supported.
127 # @virgl: The --virgl command line option is supported.
132 'enum': 'VHostUserBackendGPUFeature',
133 'data': [ 'render-node', 'virgl' ]
137 # @VHostUserBackendCapabilitiesGPU:
139 # Capabilities reported by vhost user "gpu" backends.
141 # @features: list of supported features.
146 'struct': 'VHostUserBackendCapabilitiesGPU',
148 'features': [ 'VHostUserBackendGPUFeature' ]
153 # @VHostUserBackendCapabilities:
155 # Capabilities reported by vhost user backends.
157 # @type: The vhost user backend type.
162 'union': 'VHostUserBackendCapabilities',
163 'base': { 'type': 'VHostUserBackendType' },
164 'discriminator': 'type',
166 'input': 'VHostUserBackendCapabilitiesInput',
167 'gpu': 'VHostUserBackendCapabilitiesGPU'
174 # Describes a vhost user backend to management software.
176 # It is possible for multiple @VhostUserBackend elements to match the
177 # search criteria of management software. Applications thus need rules
178 # to pick one of the many matches, and users need the ability to
179 # override distro defaults.
181 # It is recommended to create vhost user backend JSON files (each
182 # containing a single @VhostUserBackend root element) with a
183 # double-digit prefix, for example "50-qemu-gpu.json",
184 # "50-crosvm-gpu.json", etc, so they can be sorted in predictable
185 # order. The backend JSON files should be searched for in three
188 # - /usr/share/qemu/vhost-user -- populated by distro-provided
189 # packages (XDG_DATA_DIRS covers
190 # /usr/share by default),
192 # - /etc/qemu/vhost-user -- exclusively for sysadmins' local additions,
194 # - $XDG_CONFIG_HOME/qemu/vhost-user -- exclusively for per-user local
195 # additions (XDG_CONFIG_HOME
196 # defaults to $HOME/.config).
198 # Top-down, the list of directories goes from general to specific.
200 # Management software should build a list of files from all three
201 # locations, then sort the list by filename (i.e., basename
202 # component). Management software should choose the first JSON file on
203 # the sorted list that matches the search criteria. If a more specific
204 # directory has a file with same name as a less specific directory,
205 # then the file in the more specific directory takes effect. If the
206 # more specific file is zero length, it hides the less specific one.
208 # For example, if a distro ships
210 # - /usr/share/qemu/vhost-user/50-qemu-gpu.json
212 # - /usr/share/qemu/vhost-user/50-crosvm-gpu.json
214 # then the sysadmin can prevent the default QEMU GPU being used at all with
216 # $ touch /etc/qemu/vhost-user/50-qemu-gpu.json
218 # The sysadmin can replace/alter the distro default QEMU GPU with
220 # $ vim /etc/qemu/vhost-user/50-qemu-gpu.json
222 # or they can provide a parallel QEMU GPU with higher priority
224 # $ vim /etc/qemu/vhost-user/10-qemu-gpu.json
226 # or they can provide a parallel QEMU GPU with lower priority
228 # $ vim /etc/qemu/vhost-user/99-qemu-gpu.json
230 # @type: The vhost user backend type.
232 # @description: Provides a human-readable description of the backend.
233 # Management software may or may not display @description.
235 # @binary: Absolute path to the backend binary.
237 # @tags: An optional list of auxiliary strings associated with the
238 # backend for which @description is not appropriate, due to the
239 # latter's possible exposure to the end-user. @tags serves
240 # development and debugging purposes only, and management
241 # software shall explicitly ignore it.
248 # "description": "QEMU vhost-user-gpu",
250 # "binary": "/usr/libexec/qemu/vhost-user-gpu",
252 # "CONFIG_OPENGL_DMABUF=y"
258 'struct' : 'VhostUserBackend',
260 'description': 'str',
261 'type': 'VHostUserBackendType',