The <linux/vhost.h> of glib-2.17 begins with:
#ifndef _LINUX_VHOST_H
#define _LINUX_VHOST_H
/* Userspace interface for in-kernel virtio accelerators. */
/* vhost is used to reduce the number of system calls involved in virtio.
*
* Existing virtio net code is used in the guest without modification.
*
* This header includes interface used by userspace hypervisor for
* device configuration.
*/
#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/virtio_config.h>
#include <linux/virtio_ring.h>
See
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/+/refs/heads/master/sysroot/usr/include/linux/vhost.hHere's the compilation error I get in this case:
FAILED: subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o
/src/prebuilts/clang/clang-r487747/bin/clang --sysroot=/out/sysroot -m64 -mcx16 -Isubprojects/libvhost-user/libvhost-user.a.p -Isubprojects/libvhost-user -I../../
src/third_party/qemu/subprojects/libvhost-user -I/out/dest-install/usr/include -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu99 -O2 -g -Wsign-compare -Wdeclarat
ion-after-statement -Wstrict-aliasing -fno-pie -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -Wundef -Wwrite-strings -Wmissi
ng-prototypes -Wstrict-prototypes -Wredundant-decls -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-b
ody -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wmissing-format-attribute -Wthread-safety -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-sh
ift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-at-end -fstack-
protector-strong -pthread -D_GNU_SOURCE -MD -MQ subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -MF subprojects/libvhost-user/libvhost-user.a.p/libv
host-user.c.o.d -o subprojects/libvhost-user/libvhost-user.a.p/libvhost-user.c.o -c ../../src/third_party/qemu/subprojects/libvhost-user/libvhost-user.c
../../src/third_party/qemu/subprojects/libvhost-user/libvhost-user.c:529:17: error: use of undeclared identifier 'VIRTIO_F_VERSION_1'
1ULL << VIRTIO_F_VERSION_1 |
^
../../src/third_party/qemu/subprojects/libvhost-user/libvhost-user.c:563:30: error: use of undeclared identifier 'VIRTIO_F_VERSION_1'
if (!vu_has_feature(dev, VIRTIO_F_VERSION_1)) {
^
../../src/third_party/qemu/subprojects/libvhost-user/libvhost-user.c:632:22: warning: unused variable 'dev_region' [-Wunused-variable]
VuDevRegion *dev_region = &dev->regions[i];
^
../../src/third_party/qemu/subprojects/libvhost-user/libvhost-user.c:633:13: warning: unused variable 'ret' [-Wunused-variable]
int ret;
^
2 warnings and 2 errors generated.