aboutsummaryrefslogtreecommitdiff
path: root/subprojects/libvhost-user/libvhost-user.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2023-04-05 14:59:19 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2023-04-28 12:50:34 +0200
commit193ba660af14fc20cddaa04c20bb79ed05d1dbf0 (patch)
treedd512f8520324d984a14b9226aa81ef7922e9a38 /subprojects/libvhost-user/libvhost-user.c
parentd1a1111514333e46a98b136235f71eef90d610fa (diff)
Fix libvhost-user.c compilation.
The source file uses VIRTIO_F_VERSION_1 which is not defined by <linux/virtio_config.h> on Debian 10. The system-provided <linux/virtio_config.h> which does not include the macro definition is included through <linux/vhost.h>, so fix the issue by including the standard-headers version before that. Signed-off-by: David 'Digit' Turner <digit@google.com> Message-Id: <20230405125920.2951721-2-digit@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'subprojects/libvhost-user/libvhost-user.c')
-rw-r--r--subprojects/libvhost-user/libvhost-user.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index 0abd898a52..8fb61e2df2 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -32,6 +32,12 @@
#include <sys/mman.h>
#include <endian.h>
+/* Necessary to provide VIRTIO_F_VERSION_1 on system
+ * with older linux headers. Must appear before
+ * <linux/vhost.h> below.
+ */
+#include "standard-headers/linux/virtio_config.h"
+
#if defined(__linux__)
#include <sys/syscall.h>
#include <fcntl.h>