Files
qemu-reims-vgpu/util
Vladimir Sementsov-Ogievskiy e3b12d0c55 util/event_notifier: more strict API
We have .initialized in EventNotifier to track was it actually
initialized, and we have a comment that @fd passed to
event_notifier_init_fd() must be an eventfd object.

Still, there are two specific users, which ignore these things,
and use -1 as specific value storing in notifier, to mark it
"uninitialized".

Let's make strict API:

- store only valid FDs in initialized notifier
- _set() asserts that passed fd is valid
- _get() asserts that notifier is initialized (actually, except
  the two specific cases we rework, all other callers are not
  prepared to notifier being uninitialized when _get() is called.
  In this case _get() returns 0 (which is a valid fd), and caller
  will mistakenly use it, which is worse than abort())
- for two specific cases, implement additional getter for .initialized
  field itself
- zeroed notifier is uninitialized(.initialized is false)

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260911185800.134135-1-vsementsov@yandex-team.ru>
2026-10-29 14:27:25 -04:00
..
…
2023-03-20 12:43:50 +01:00
…
2023-12-19 19:03:38 +01:00
2026-04-29 11:41:00 +10:00
2026-04-29 11:41:00 +10:00
2026-04-22 12:51:51 +04:00
…
…
2025-10-01 08:33:24 +02:00
…
2025-03-10 17:07:16 +08:00
2025-01-29 11:43:04 -03:00
2023-04-24 11:29:00 +02:00
2026-04-23 12:27:27 +02:00
2023-08-31 19:47:43 +02:00
2023-03-28 15:23:10 -07:00
2023-11-15 12:06:05 +03:00
2026-04-22 12:51:51 +04:00
…
…
2023-11-03 09:20:31 +01:00