On Mon, May 25, 2026 at 11:27:30AM -0700, [email protected] wrote:
> 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]>


Hmm. maybe replace linux/vhost.h with standard-headers/linux/vhost.h then?


> ---
>  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 699863cc10..10e8fbe503 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"
> -- 
> 2.43.0


Reply via email to