*/
#include "qemu/osdep.h"
#include "block/block.h"
-#include "contrib/libvhost-user/libvhost-user.h"
+#include "subprojects/libvhost-user/libvhost-user.h" /* only for the type definitions */
#include "standard-headers/linux/virtio_blk.h"
#include "qemu/vhost-user-server.h"
#include "vhost-user-blk-server.h"
+++ /dev/null
-libvhost_user = static_library('vhost-user',
- files('libvhost-user.c', 'libvhost-user-glib.c'),
- build_by_default: false)
-vhost_user = declare_dependency(link_with: libvhost_user)
# FIXME: broken on 32-bit architectures
executable('vhost-user-blk', files('vhost-user-blk.c'),
- link_with: libvhost_user,
- dependencies: qemuutil,
+ dependencies: [qemuutil, vhost_user],
build_by_default: false,
install: false)
#include "qemu/osdep.h"
#include "standard-headers/linux/virtio_blk.h"
-#include "contrib/libvhost-user/libvhost-user-glib.h"
-#include "contrib/libvhost-user/libvhost-user.h"
+#include "libvhost-user-glib.h"
#if defined(__linux__)
#include <linux/fs.h>
and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \
and pixman.found()
executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
- link_with: libvhost_user,
- dependencies: [qemuutil, pixman, gbm, virgl],
+ dependencies: [qemuutil, pixman, gbm, virgl, vhost_user],
install: true,
install_dir: get_option('libexecdir'))
#include "qemu/osdep.h"
-#include "contrib/libvhost-user/libvhost-user-glib.h"
+#include "libvhost-user-glib.h"
#include "standard-headers/linux/virtio_gpu.h"
#include "qemu/queue.h"
#include "qemu/iov.h"
#include "qemu/bswap.h"
#include "qemu/sockets.h"
-#include "contrib/libvhost-user/libvhost-user.h"
-#include "contrib/libvhost-user/libvhost-user-glib.h"
+#include "libvhost-user-glib.h"
#include "standard-headers/linux/virtio_input.h"
#include "qapi/error.h"
executable('vhost-user-input', files('main.c'),
- link_with: libvhost_user,
- dependencies: qemuutil,
+ dependencies: [qemuutil, vhost_user],
build_by_default: targetos == 'linux',
install: false)
if 'CONFIG_LIBISCSI' in config_host
executable('vhost-user-scsi', files('vhost-user-scsi.c'),
- link_with: libvhost_user,
- dependencies: [qemuutil, libiscsi],
+ dependencies: [qemuutil, libiscsi, vhost_user],
build_by_default: targetos == 'linux',
install: false)
endif
#define inline __attribute__((gnu_inline)) /* required for libiscsi v1.9.0 */
#include <iscsi/scsi-lowlevel.h>
#undef inline
-#include "contrib/libvhost-user/libvhost-user-glib.h"
+#include "libvhost-user-glib.h"
#include "standard-headers/linux/virtio_scsi.h"
#ifndef VHOST_USER_SERVER_H
#define VHOST_USER_SERVER_H
-#include "contrib/libvhost-user/libvhost-user.h"
+#include "subprojects/libvhost-user/libvhost-user.h" /* only for the type definitions */
#include "io/channel-socket.h"
#include "io/channel-file.h"
#include "io/net-listener.h"
'util',
]
-subdir('contrib/libvhost-user')
+vhost_user = not_found
+if 'CONFIG_VHOST_USER' in config_host
+ libvhost_user = subproject('libvhost-user')
+ vhost_user = libvhost_user.get_variable('vhost_user_dep')
+endif
+
subdir('qapi')
subdir('qobject')
subdir('stubs')
--- /dev/null
+project('libvhost-user', 'c',
+ license: 'GPL-2.0-or-later',
+ default_options: ['c_std=gnu99'])
+
+glib = dependency('glib-2.0')
+inc = include_directories('../../include', '../../linux-headers')
+
+vhost_user = static_library('vhost-user',
+ files('libvhost-user.c'),
+ include_directories: inc,
+ c_args: '-D_GNU_SOURCE')
+
+vhost_user_glib = static_library('vhost-user-glib',
+ files('libvhost-user-glib.c'),
+ include_directories: inc,
+ link_with: vhost_user,
+ dependencies: glib)
+
+vhost_user_dep = declare_dependency(link_with: vhost_user_glib,
+ include_directories: include_directories('.'))
if have_tools and 'CONFIG_VHOST_USER' in config_host and 'CONFIG_LINUX' in config_host
executable('vhost-user-bridge',
sources: files('vhost-user-bridge.c'),
- link_with: [libvhost_user],
- dependencies: [qemuutil])
+ dependencies: [qemuutil, vhost_user])
endif
if have_system and 'CONFIG_POSIX' in config_host
#include "qemu/ctype.h"
#include "qemu/iov.h"
#include "standard-headers/linux/virtio_net.h"
-#include "contrib/libvhost-user/libvhost-user.h"
+#include "libvhost-user.h"
#define VHOST_USER_BRIDGE_DEBUG 1
#include <grp.h>
#include <unistd.h>
-#include "contrib/libvhost-user/libvhost-user.h"
+#include "libvhost-user.h"
struct fv_VuDev;
struct fv_QueueInfo {
'helper.c',
'passthrough_ll.c',
'passthrough_seccomp.c'),
- link_with: libvhost_user,
- dependencies: [seccomp, qemuutil, libcap_ng],
+ dependencies: [seccomp, qemuutil, libcap_ng, vhost_user],
install: true,
install_dir: get_option('libexecdir'))