All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Quan.Sun@windriver.com
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, fam@euphon.net,
	sgarzare@redhat.com
Subject: Re: [PATCH] hw/scsi/vhost-scsi: fix build with older kernel headers
Date: Mon, 25 May 2026 18:39:09 -0400	[thread overview]
Message-ID: <20260525183656-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260525182730.4098543-1-Quan.Sun@windriver.com>

On Mon, May 25, 2026 at 11:27:30AM -0700, Quan.Sun@windriver.com wrote:
> From: Quan Sun <Quan.Sun@windriver.com>
> 
> 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>


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	other threads:[~2026-05-25 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 18:27 [PATCH] hw/scsi/vhost-scsi: fix build with older kernel headers Quan.Sun
2026-05-25 22:39 ` Michael S. Tsirkin [this message]
2026-05-26 14:27   ` Quan Sun
2026-05-26 18:05     ` Michael S. Tsirkin
2026-05-27 16:16 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260525183656-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=Quan.Sun@windriver.com \
    --cc=fam@euphon.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.