|
From: | Paolo Bonzini |
Subject: | Re: [PATCH 1/2] Fix libvhost-user.c compilation. |
Date: | Wed, 26 Apr 2023 21:13:32 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 |
On 4/7/23 09:56, Michael S. Tsirkin wrote:
On Wed, Apr 05, 2023 at 02:59:19PM +0200, David 'Digit' Turner wrote: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>I don't get it. ./linux-headers/linux/vhost.h does not seem to use <linux/virtio_config.h> for me.
The issue is that subprojects/libvhost-user/libvhost-user.c includes linux/vhost.h. Probably should be changed to linux-headers/linux/vhost.h, but David's patch makes sense because libvhost-user.c does use a symbol from virtio_config.h.
Paolo
$ git grep linux/virtio_config.h include/hw/virtio/virtio.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/vhost_types.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_9p.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_balloon.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_blk.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_console.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_crypto.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_fs.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_mem.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_net.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_pmem.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_rng.h:#include "standard-headers/linux/virtio_config.h" include/standard-headers/linux/virtio_vsock.h:#include "standard-headers/linux/virtio_config.h" linux-headers/linux/virtio_config.h:#include "standard-headers/linux/virtio_config.h" scripts/update-linux-headers.sh:cat <<EOF >$output/linux-headers/linux/virtio_config.h scripts/update-linux-headers.sh:#include "standard-headers/linux/virtio_config.h" subprojects/libvduse/libvduse.c:#include "linux-headers/linux/virtio_config.h" tests/qtest/fuzz/virtio_net_fuzz.c:#include "standard-headers/linux/virtio_config.h" tests/qtest/libqos/virtio-gpio.c:#include "standard-headers/linux/virtio_config.h" tests/qtest/libqos/virtio-pci-modern.c:#include "standard-headers/linux/virtio_config.h" tests/qtest/libqos/virtio.c:#include "standard-headers/linux/virtio_config.h"--- subprojects/libvhost-user/libvhost-user.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c index 0200b78e8e..0a5768cb55 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> -- 2.40.0.348.gf938b09366-goog
[Prev in Thread] | Current Thread | [Next in Thread] |