From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Warner Losh" <imp@bsdimp.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kyle Evans" <kevans@freebsd.org>,
"Li-Wen Hsu" <lwhsu@freebsd.org>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Jessica Clarke" <jrtc27@jrtc27.com>
Subject: [PULL 1/5] test-util-filemonitor: Adapt to FreeBSD 15's native inotify semantics
Date: Tue, 21 Jul 2026 16:55:50 +0100 [thread overview]
Message-ID: <20260721155554.128840-2-berrange@redhat.com> (raw)
In-Reply-To: <20260721155554.128840-1-berrange@redhat.com>
From: Jessica Clarke <jrtc27@jrtc27.com>
FreeBSD 15 introduces a native inotify implementation rather than
requiring use of the kqueue-based libinotify package. This native
implementation does not generate the extra deleted events, so don't
expect them. However, the original implementation did have a bug that
caused IN_IGNORED to never be generated if you did not also watch for
IN_DELETE_SELF, which affects 15.0 and 15.1, but has been fixed and will
no longer apply in 15.2 / 16.0.
Note that the deleted event check is for the userspace version, since
that governs whether libinotify is being used or not, whereas the
ignored event check is both for the userspace version (to check if we're
using the native syscall) and the kernel version (to check if the kernel
has the bug or not).
All __FreeBSD_version values used here correspond to the value in-tree
at the time of the relevant commits. Since neither commit bumped the
value there will be a window of development snapshots between each
commit and the previous bump that will be incorrectly identified here,
but this is the best we can do, and something users of snapshots should
be prepared to deal with.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
tests/unit/test-util-filemonitor.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/tests/unit/test-util-filemonitor.c b/tests/unit/test-util-filemonitor.c
index 02e67fc96a..972651dc1e 100644
--- a/tests/unit/test-util-filemonitor.c
+++ b/tests/unit/test-util-filemonitor.c
@@ -27,6 +27,10 @@
#include <utime.h>
+#ifdef __FreeBSD__
+#include <osreldate.h>
+#endif
+
enum {
QFILE_MONITOR_TEST_OP_ADD_WATCH,
QFILE_MONITOR_TEST_OP_DEL_WATCH,
@@ -221,6 +225,24 @@ qemu_file_monitor_test_expect(QFileMonitorTestData *data,
}
+static bool
+expect_broken_ignored(void)
+{
+#if defined(__FreeBSD__) && __FreeBSD_version >= 1500051
+ int osreldate;
+
+ osreldate = getosreldate();
+ if (osreldate == -1) {
+ g_printerr("Unable to call getosreldate: %s\n", strerror(errno));
+ abort();
+ }
+ return osreldate < 1501501 || (osreldate >= 1600000 && osreldate < 1600019);
+#else
+ return false;
+#endif
+}
+
+
static void
test_file_monitor_events(void)
{
@@ -360,7 +382,7 @@ test_file_monitor_events(void)
{ .type = QFILE_MONITOR_TEST_OP_EVENT,
.filesrc = "one.txt", .watchid = &watch4,
.eventid = QFILE_MONITOR_EVENT_DELETED },
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) && __FreeBSD_version < 1500051
{ .type = QFILE_MONITOR_TEST_OP_EVENT,
.filesrc = "two.txt", .watchid = &watch0,
.eventid = QFILE_MONITOR_EVENT_DELETED },
@@ -539,6 +561,11 @@ test_file_monitor_events(void)
g_printerr("Event id=%" PRIx64 " event=%d file=%s\n",
*op->watchid, op->eventid, op->filesrc);
}
+ if (op->eventid == QFILE_MONITOR_EVENT_IGNORED &&
+ expect_broken_ignored()) {
+ g_printerr("Expect ignored event to be broken, skipping\n");
+ break;
+ }
if (!qemu_file_monitor_test_expect(&data, *op->watchid,
op->eventid, op->filesrc,
op->swapnext))
--
2.55.0
next prev parent reply other threads:[~2026-07-21 15:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 15:55 [PULL 0/5] Misc patches Daniel P. Berrangé
2026-07-21 15:55 ` Daniel P. Berrangé [this message]
2026-07-21 15:55 ` [PULL 2/5] tests/vm: update to FreeBSD 14.4 image Daniel P. Berrangé
2026-07-21 15:55 ` [PULL 3/5] meson.build: re-add explicit gcrypt/nettle request check Daniel P. Berrangé
2026-07-21 15:55 ` [PULL 4/5] gitlab: introduce files mapping GitLab accounts to real names Daniel P. Berrangé
2026-07-21 15:55 ` [PULL 5/5] get_maintainer: add ability to report Git Lab handle Daniel P. Berrangé
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=20260721155554.128840-2-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=imp@bsdimp.com \
--cc=jrtc27@jrtc27.com \
--cc=kevans@freebsd.org \
--cc=lwhsu@freebsd.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@mailo.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--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.