@samitouri / QOSamiQemu / commits / 062c1b7d03

hw/scsi/vhost-scsi: fix build with older kernel headers

On build hosts with kernel headers older than 6.0, the system's <linux/vhost_types.h> does not define struct vhost_vring_worker or struct vhost_worker_state, causing compilation of vhost-scsi.c to fail: error: storage size of 'vq_worker' isn't known Fix by including standard-headers/linux/vhost_types.h before the system's <linux/vhost.h>, matching the existing pattern used in hw/virtio/vhost-backend.c. QEMU's bundled header provides the struct definitions, and its include guard prevents redefinition when the system header pulls in its own vhost_types.h. Signed-off-by: Quan Sun <Quan.Sun@windriver.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260525182730.4098543-1-Quan.Sun@windriver.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Quan Sun committed May 25, 2026 at 11:27 UTC 062c1b7d033e675ea622939b444d57516be56f6a
1 file changed +1
hw/scsi/vhost-scsi.c
+1
@@ -15,6 +15,7 @@
15 */
16
17 #include "qemu/osdep.h"
18 +#include "standard-headers/linux/vhost_types.h"
19 #include <linux/vhost.h>
20 #include <sys/ioctl.h>
21 #include "qapi/error.h"