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
38 'enum': 'VHostUserBackendType',
58 # @VHostUserBackendInputFeature:
60 # List of vhost user "input" features.
62 # @evdev-path: The --evdev-path command line option is supported.
63 # @no-grab: The --no-grab command line option is supported.
68 'enum': 'VHostUserBackendInputFeature',
69 'data': [ 'evdev-path', 'no-grab' ]
73 # @VHostUserBackendCapabilitiesInput:
75 # Capabilities reported by vhost user "input" backends
77 # @features: list of supported features.
82 'struct': 'VHostUserBackendCapabilitiesInput',
84 'features': [ 'VHostUserBackendInputFeature' ]
89 # @VHostUserBackendGPUFeature:
91 # List of vhost user "gpu" features.
93 # @render-node: The --render-node command line option is supported.
94 # @virgl: The --virgl command line option is supported.
99 'enum': 'VHostUserBackendGPUFeature',
100 'data': [ 'render-node', 'virgl' ]
104 # @VHostUserBackendCapabilitiesGPU:
106 # Capabilities reported by vhost user "gpu" backends.
108 # @features: list of supported features.
113 'struct': 'VHostUserBackendCapabilitiesGPU',
115 'features': [ 'VHostUserBackendGPUFeature' ]
120 # @VHostUserBackendCapabilities:
122 # Capabilities reported by vhost user backends.
124 # @type: The vhost user backend type.
129 'union': 'VHostUserBackendCapabilities',
130 'base': { 'type': 'VHostUserBackendType' },
131 'discriminator': 'type',
133 'input': 'VHostUserBackendCapabilitiesInput',
134 'gpu': 'VHostUserBackendCapabilitiesGPU'
141 # Describes a vhost user backend to management software.
143 # It is possible for multiple @VhostUserBackend elements to match the
144 # search criteria of management software. Applications thus need rules
145 # to pick one of the many matches, and users need the ability to
146 # override distro defaults.
148 # It is recommended to create vhost user backend JSON files (each
149 # containing a single @VhostUserBackend root element) with a
150 # double-digit prefix, for example "50-qemu-gpu.json",
151 # "50-crosvm-gpu.json", etc, so they can be sorted in predictable
152 # order. The backend JSON files should be searched for in three
155 # - /usr/share/qemu/vhost-user -- populated by distro-provided
156 # packages (XDG_DATA_DIRS covers
157 # /usr/share by default),
159 # - /etc/qemu/vhost-user -- exclusively for sysadmins' local additions,
161 # - $XDG_CONFIG_HOME/qemu/vhost-user -- exclusively for per-user local
162 # additions (XDG_CONFIG_HOME
163 # defaults to $HOME/.config).
165 # Top-down, the list of directories goes from general to specific.
167 # Management software should build a list of files from all three
168 # locations, then sort the list by filename (i.e., basename
169 # component). Management software should choose the first JSON file on
170 # the sorted list that matches the search criteria. If a more specific
171 # directory has a file with same name as a less specific directory,
172 # then the file in the more specific directory takes effect. If the
173 # more specific file is zero length, it hides the less specific one.
175 # For example, if a distro ships
177 # - /usr/share/qemu/vhost-user/50-qemu-gpu.json
179 # - /usr/share/qemu/vhost-user/50-crosvm-gpu.json
181 # then the sysadmin can prevent the default QEMU GPU being used at all with
183 # $ touch /etc/qemu/vhost-user/50-qemu-gpu.json
185 # The sysadmin can replace/alter the distro default QEMU GPU with
187 # $ vim /etc/qemu/vhost-user/50-qemu-gpu.json
189 # or they can provide a parallel QEMU GPU with higher priority
191 # $ vim /etc/qemu/vhost-user/10-qemu-gpu.json
193 # or they can provide a parallel QEMU GPU with lower priority
195 # $ vim /etc/qemu/vhost-user/99-qemu-gpu.json
197 # @type: The vhost user backend type.
199 # @description: Provides a human-readable description of the backend.
200 # Management software may or may not display @description.
202 # @binary: Absolute path to the backend binary.
204 # @tags: An optional list of auxiliary strings associated with the
205 # backend for which @description is not appropriate, due to the
206 # latter's possible exposure to the end-user. @tags serves
207 # development and debugging purposes only, and management
208 # software shall explicitly ignore it.
215 # "description": "QEMU vhost-user-gpu",
217 # "binary": "/usr/libexec/qemu/vhost-user-gpu",
219 # "CONFIG_OPENGL_DMABUF=y"
225 'struct' : 'VhostUserBackend',
227 'description': 'str',
228 'type': 'VHostUserBackendType',