libvduse: Add VDUSE (vDPA Device in Userspace) library

VDUSE [1] is a linux framework that makes it possible to implement
software-emulated vDPA devices in userspace. This adds a library
as a subproject to help implementing VDUSE backends in QEMU.

[1] https://www.kernel.org/doc/html/latest/userspace-api/vduse.html

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Message-Id: <20220523084611.91-6-xieyongji@bytedance.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Xie Yongji 2022-05-23 16:46:08 +08:00 committed by Kevin Wolf
parent 92e879505f
commit a6caeee811
11 changed files with 1424 additions and 0 deletions

View file

@ -1541,6 +1541,15 @@ if get_option('fuse_lseek').allowed()
endif
endif
have_libvduse = (targetos == 'linux')
if get_option('libvduse').enabled()
if targetos != 'linux'
error('libvduse requires linux')
endif
elif get_option('libvduse').disabled()
have_libvduse = false
endif
# libbpf
libbpf = dependency('libbpf', required: get_option('bpf'), method: 'pkg-config')
if libbpf.found() and not cc.links('''
@ -2986,6 +2995,12 @@ if targetos == 'linux' and have_vhost_user
vhost_user = libvhost_user.get_variable('vhost_user_dep')
endif
libvduse = not_found
if have_libvduse
libvduse_proj = subproject('libvduse')
libvduse = libvduse_proj.get_variable('libvduse_dep')
endif
# NOTE: the trace/ subdirectory needs the qapi_trace_events variable
# that is filled in by qapi/.
subdir('qapi')