From: Quan Sun <[email protected]> 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 <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Message-Id: <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> --- hw/scsi/vhost-scsi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index 859888fdba..657403cad0 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -15,6 +15,7 @@ */ #include "qemu/osdep.h" +#include "standard-headers/linux/vhost_types.h" #include <linux/vhost.h> #include <sys/ioctl.h> #include "qapi/error.h" -- MST
