[PATCH] vfio/listener: Remove unnecessary linux/kvm.h include

Cédric Le Goater posted 1 patch 4 days, 3 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260721062745.3793066-1-clg@redhat.com
Maintainers: Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>
hw/vfio/listener.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] vfio/listener: Remove unnecessary linux/kvm.h include
Posted by Cédric Le Goater 4 days, 3 hours ago
Since commit d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM"),
the linux/kvm.h include is unconditional. This breaks the build on
targets that lack asm/kvm.h such as sparc and sparc64:

  In file included from ../hw/vfio/listener.c:23:
  linux-headers/linux/kvm.h:16:10: fatal error: asm/kvm.h: No such file or directory

This include is not needed in listener.c which only uses kvm_enabled()
and kvm_get_max_memslots(), both are declared in "system/kvm.h".
Remove it.

Fixes: d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM")
Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>"
Suggested-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/vfio/listener.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c
index c19600e980a8d02217b5d9df4aca8f879ab2c5d5..008f488a3e7d4ca2ec9e1780b496371b0f447653 100644
--- a/hw/vfio/listener.c
+++ b/hw/vfio/listener.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include <sys/ioctl.h>
-#include <linux/kvm.h>
 #include <linux/vfio.h>
 
 #include "exec/target_page.h"
-- 
2.55.0


Re: [PATCH] vfio/listener: Remove unnecessary linux/kvm.h include
Posted by Pierrick Bouvier 3 days, 18 hours ago
On 7/20/2026 11:27 PM, Cédric Le Goater wrote:
> Since commit d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM"),
> the linux/kvm.h include is unconditional. This breaks the build on
> targets that lack asm/kvm.h such as sparc and sparc64:
> 
>   In file included from ../hw/vfio/listener.c:23:
>   linux-headers/linux/kvm.h:16:10: fatal error: asm/kvm.h: No such file or directory
> 
> This include is not needed in listener.c which only uses kvm_enabled()
> and kvm_get_max_memslots(), both are declared in "system/kvm.h".
> Remove it.
> 
> Fixes: d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM")
> Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>"
> Suggested-by: Alex Williamson <alex@shazbot.org>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>  hw/vfio/listener.c | 1 -
>  1 file changed, 1 deletion(-)
> 

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>

Re: [PATCH] vfio/listener: Remove unnecessary linux/kvm.h include
Posted by Alex Williamson 3 days, 20 hours ago
On Tue, Jul 21, 2026, at 12:27 AM, Cédric Le Goater wrote:
> Since commit d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM"),
> the linux/kvm.h include is unconditional. This breaks the build on
> targets that lack asm/kvm.h such as sparc and sparc64:
>
>   In file included from ../hw/vfio/listener.c:23:
>   linux-headers/linux/kvm.h:16:10: fatal error: asm/kvm.h: No such file 
> or directory
>
> This include is not needed in listener.c which only uses kvm_enabled()
> and kvm_get_max_memslots(), both are declared in "system/kvm.h".
> Remove it.
>
> Fixes: d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM")
> Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>"
> Suggested-by: Alex Williamson <alex@shazbot.org>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>  hw/vfio/listener.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/vfio/listener.c b/hw/vfio/listener.c
> index 
> c19600e980a8d02217b5d9df4aca8f879ab2c5d5..008f488a3e7d4ca2ec9e1780b496371b0f447653 
> 100644
> --- a/hw/vfio/listener.c
> +++ b/hw/vfio/listener.c
> @@ -20,7 +20,6 @@
> 
>  #include "qemu/osdep.h"
>  #include <sys/ioctl.h>
> -#include <linux/kvm.h>
>  #include <linux/vfio.h>
> 
>  #include "exec/target_page.h"
> -- 
> 2.55.0

Reviewed-by: Alex Williamson <alex@shazbot.org>
Re: [PATCH] vfio/listener: Remove unnecessary linux/kvm.h include
Posted by Philippe Mathieu-Daudé 4 days, 1 hour ago
On 21/7/26 08:27, Cédric Le Goater wrote:
> Since commit d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM"),
> the linux/kvm.h include is unconditional. This breaks the build on
> targets that lack asm/kvm.h such as sparc and sparc64:
> 
>    In file included from ../hw/vfio/listener.c:23:
>    linux-headers/linux/kvm.h:16:10: fatal error: asm/kvm.h: No such file or directory
> 
> This include is not needed in listener.c which only uses kvm_enabled()
> and kvm_get_max_memslots(), both are declared in "system/kvm.h".
> Remove it.
> 
> Fixes: d0e8bccafc23 ("hw/vfio/listener.c: remove CONFIG_KVM")
> Cc: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>"
> Suggested-by: Alex Williamson <alex@shazbot.org>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>   hw/vfio/listener.c | 1 -
>   1 file changed, 1 deletion(-)

Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>