[PATCH] meson.build: stop checking for inotify_init()

Michael Tokarev posted 1 patch 3 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260311124008.1070746-1-mjt@tls.msk.ru
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
meson.build | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[PATCH] meson.build: stop checking for inotify_init()
Posted by Michael Tokarev 3 weeks, 6 days ago
the only place in qemu which used the check for inotify_init()
was linux-user, which now assumes inotify_init() is always
present.  There's no need to check for this function anymore.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
This is on top of:
 https://lore.kernel.org/qemu-trivial/20260119140557.2167351-2-mjt@tls.msk.ru/T/#u
which gets rid of usage of CONFIG_INOTIFY from linux-user/.

 meson.build | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 5143639a19..a513d3eb3a 100644
--- a/meson.build
+++ b/meson.build
@@ -2675,15 +2675,12 @@ endif
 config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber)
 
 inotify = not_found
-have_inotify_init = cc.has_header_symbol('sys/inotify.h', 'inotify_init')
 have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 'inotify_init1')
-if (have_inotify_init or have_inotify_init1) and not cc.has_function('inotify_init1')
+if have_inotify_init1 and not cc.has_function('inotify_init1')
   # FreeBSD 14 and older need libinotify-kqueue wrapper
   inotify = cc.find_library('inotify')
-  have_inotify_init = have_inotify_init and inotify.found()
   have_inotify_init1 = have_inotify_init1 and inotify.found()
 endif
-config_host_data.set('CONFIG_INOTIFY', have_inotify_init)
 config_host_data.set('CONFIG_INOTIFY1', have_inotify_init1)
 
 # has_header_symbol
-- 
2.47.3
Re: [PATCH] meson.build: stop checking for inotify_init()
Posted by Paolo Bonzini 3 weeks, 6 days ago
Queued, thanks.

Paolo
Re: [PATCH] meson.build: stop checking for inotify_init()
Posted by Michael Tokarev 3 weeks, 6 days ago
On 11.03.2026 19:02, Paolo Bonzini wrote:
> Queued, thanks.

Please don't queue it up without the previous patch which
stops linux-user/ from checking CONFIG_INOTIFY.

https://lore.kernel.org/qemu-trivial/20260119140557.2167351-2-mjt@tls.msk.ru/T/#u

I planned to submit whole thing through the trivial-patches
tree for 11.0.

Or if you queue it up, please queue the mentioned patch before
this one.

Thanks,

/mjt
Re: [PATCH] meson.build: stop checking for inotify_init()
Posted by Michael Tokarev 3 weeks, 6 days ago
On 11.03.2026 15:40, Michael Tokarev wrote:
> the only place in qemu which used the check for inotify_init()
> was linux-user, which now assumes inotify_init() is always
> present.  There's no need to check for this function anymore.
> 
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> This is on top of:
>   https://lore.kernel.org/qemu-trivial/20260119140557.2167351-2-mjt@tls.msk.ru/T/#u
> which gets rid of usage of CONFIG_INOTIFY from linux-user/.
> 
>   meson.build | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 5143639a19..a513d3eb3a 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2675,15 +2675,12 @@ endif
>   config_host_data.set('CONFIG_ASAN_IFACE_FIBER', have_asan_fiber)
>   
>   inotify = not_found
> -have_inotify_init = cc.has_header_symbol('sys/inotify.h', 'inotify_init')
>   have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 'inotify_init1')
> -if (have_inotify_init or have_inotify_init1) and not cc.has_function('inotify_init1')
> +if have_inotify_init1 and not cc.has_function('inotify_init1')
>     # FreeBSD 14 and older need libinotify-kqueue wrapper
>     inotify = cc.find_library('inotify')
> -  have_inotify_init = have_inotify_init and inotify.found()

>     have_inotify_init1 = have_inotify_init1 and inotify.found()

This should be simplified further as

       have_inotify_init1 = inotify.found()

though I'm not sure how it's possible to have inotify_init1 symbol in
header but not in some library - either libc or libinotify.  Maybe this
whole if..endif can be simplified further.

>   endif

Thanks,

/mjt