* [PATCH v2] freebsd: FreeBSD 15 has native inotify
@ 2026-02-10 18:27 Warner Losh
2026-02-10 18:30 ` Daniel P. Berrangé
0 siblings, 1 reply; 2+ messages in thread
From: Warner Losh @ 2026-02-10 18:27 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Marc-André Lureau, Daniel P. Berrangé,
Philippe Mathieu-Daudé, Warner Losh
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.
---
Changes in v2:
- Make simplifications suggested by Bonzini.
- Link to v1: https://lore.kernel.org/qemu-devel/20260210-freebsd-inotify-v1-1-009430118133@bsdimp.com
---
meson.build | 14 +++++---------
util/meson.build | 6 +-----
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/meson.build b/meson.build
index 2d114e9018..191266d9be 100644
--- a/meson.build
+++ b/meson.build
@@ -2658,18 +2658,14 @@ else
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')
-inotify = not_found
-if (have_inotify_init or have_inotify_init1) and host_os == 'freebsd'
- # libinotify-kqueue
+if (have_inotify_init or have_inotify_init1) and not cc.has_function('inotify_init1')
+ # FreeBSD 14 and older need libinotify-kqueue wrapper
inotify = cc.find_library('inotify')
- if have_inotify_init
- have_inotify_init = inotify.found()
- endif
- if have_inotify_init1
- have_inotify_init1 = inotify.found()
- endif
+ 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)
diff --git a/util/meson.build b/util/meson.build
index 7c9445615d..e7a2a2a64c 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -102,11 +102,7 @@ if have_block
util_ss.add(files('throttle.c'))
util_ss.add(files('timed-average.c'))
if config_host_data.get('CONFIG_INOTIFY1')
- freebsd_dep = []
- if host_os == 'freebsd'
- freebsd_dep = inotify
- endif
- util_ss.add(files('filemonitor-inotify.c'), freebsd_dep)
+ util_ss.add(files('filemonitor-inotify.c'), inotify)
else
util_ss.add(files('filemonitor-stub.c'))
endif
---
base-commit: 0b91040d23dc8820724a60c811223b777f3bc6b7
change-id: 20260210-freebsd-inotify-8bd07b2c84d1
Best regards,
--
Warner Losh <imp@bsdimp.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] freebsd: FreeBSD 15 has native inotify
2026-02-10 18:27 [PATCH v2] freebsd: FreeBSD 15 has native inotify Warner Losh
@ 2026-02-10 18:30 ` Daniel P. Berrangé
0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrangé @ 2026-02-10 18:30 UTC (permalink / raw)
To: Warner Losh
Cc: qemu-devel, Paolo Bonzini, Marc-André Lureau,
Philippe Mathieu-Daudé
On Tue, Feb 10, 2026 at 11:27:17AM -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.
> ---
> Changes in v2:
> - Make simplifications suggested by Bonzini.
> - Link to v1: https://lore.kernel.org/qemu-devel/20260210-freebsd-inotify-v1-1-009430118133@bsdimp.com
> ---
> meson.build | 14 +++++---------
> util/meson.build | 6 +-----
> 2 files changed, 6 insertions(+), 14 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
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 :|
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-10 18:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 18:27 [PATCH v2] freebsd: FreeBSD 15 has native inotify Warner Losh
2026-02-10 18:30 ` Daniel P. Berrangé
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.