From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Warner Losh <imp@bsdimp.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] freebsd: FreeBSD 15 has native inotify
Date: Tue, 10 Feb 2026 15:54:17 +0000 [thread overview]
Message-ID: <aYtUqbgy_axpHfn2@redhat.com> (raw)
In-Reply-To: <20260210-freebsd-inotify-v1-1-009430118133@bsdimp.com>
On Tue, Feb 10, 2026 at 08:43:48AM -0700, Warner Losh wrote:
> Check to make sure that we have inotify in libc, before looking for it
> in libinotify.
>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
> Cc: Daniel P. Berrange <berrange@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> FreeBSD 15 and newer now has a native inotify implementation. Check for
> it before checking for the wrapper libinotify library which is needed in
> FreeBSD 14 and earlier. Make the check dependent on symbols, not host
> version.
>
> Separate series because it's really independent of the two other
> patch series I have submitted and it is more important.
> ---
> meson.build | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 2d114e9018..537f50283f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2662,13 +2662,15 @@ have_inotify_init = cc.has_header_symbol('sys/inotify.h', 'inotify_init')
> have_inotify_init1 = cc.has_header_symbol('sys/inotify.h', 'inotify_init1')
> inotify = not_found
> if (have_inotify_init or have_inotify_init1) and host_os == 'freebsd'
> - # libinotify-kqueue
> - inotify = cc.find_library('inotify')
> - if have_inotify_init
> - have_inotify_init = inotify.found()
> - endif
> - if have_inotify_init1
> - have_inotify_init1 = inotify.found()
> + if not cc.has_function('inotify_init') and not cc.has_function('inotify_init1')
> + inotify = cc.find_library('inotify')
> + # libinotify-kqueue
> + if have_inotify_init
> + have_inotify_init = inotify.found()
> + endif
> + if have_inotify_init1
> + have_inotify_init1 = inotify.found()
> + endif
> endif
> endif
> config_host_data.set('CONFIG_INOTIFY', have_inotify_init)
So this ends up woth 'inotify == not_found' with either Linux,
or latest FreeBSD 15.
Over in util/meson.build though we have
freebsd_dep = []
if host_os == 'freebsd'
freebsd_dep = inotify
endif
util_ss.add(files('filemonitor-inotify.c'), freebsd_dep)
Which seems to be trying to avoid adding "not_found" to the dep list.
Either it is safe to add "not_found" to the dep list, and this code in
util/meson.build can be simplified to just:
util_ss.add(files('filemonitor-inotify.c'), [inotify])
or it is unsafe, and this code needs to be modified to look more like:
inotify_deps = []
if inotify.found()
inotify_deps = [inotify]
endif
util_ss.add(files('filemonitor-inotify.c'), inotify_deps)
Assuming you've tested your patch here successfully, then it seems like
the former case is valid, and we can simplify util/meson.dep to remove
the conditional ?
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2026-02-10 15:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 15:43 [PATCH] freebsd: FreeBSD 15 has native inotify Warner Losh
2026-02-10 15:54 ` Daniel P. Berrangé [this message]
2026-02-10 18:22 ` Warner Losh
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=aYtUqbgy_axpHfn2@redhat.com \
--to=berrange@redhat.com \
--cc=imp@bsdimp.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/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.