Skip to content

refactor(hv): replace trait IoeventFd with struct Notifier - #494

Merged
Lencerf merged 1 commit into
google:mainfrom
Lencerf:refactor/notifier-ioeventfd
Sep 13, 2026
Merged

Lencerf merged 1 commit into
google:mainfrom
Lencerf:refactor/notifier-ioeventfd

Conversation

@Lencerf

@Lencerf Lencerf commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Replace the trait IoeventFd with a concrete type struct Notifier, as only KVM supports I/O event notifications via KVM_IOEVENTFD. This simplifies functions and types.

The refactoring is also needed to support vfio-user VFIO_USER_DEVICE_GET_REGION_IO_FDS, as for vio-user devices, the eventfds are created by the device process and passed to the VMM via Unix domain sockets. Then we cannot have the IoeventFd constructor bound to the registry type.

Assisted-by: Antigravity:Claude-Opus-5

Replace the trait IoeventFd with a concrete type struct Notifier, as
only KVM supports I/O event notifications via KVM_IOEVENTFD. This
simplifies functions and types.

The refactoring is also needed to support vfio-user
VFIO_USER_DEVICE_GET_REGION_IO_FDS, as for vio-user devices, the
eventfds are created by the device process and passed to the VMM via
Unix domain sockets. Then we cannot have the IoeventFd constructor
bound to the registry type.

Assisted-by: Antigravity:Claude-Opus-5
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
@Lencerf
Lencerf merged commit fd76c97 into google:main Sep 13, 2026
13 checks passed
@Lencerf
Lencerf deleted the refactor/notifier-ioeventfd branch September 13, 2026 06:08
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 34741906547

Warning

No base build found for commit adb79c5 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 37.328%

Details

  • Patch coverage: 130 uncovered changes across 19 files (51 of 181 lines covered, 28.18%).

Uncovered Changes

Top 10 Files by Coverage Impact Changed Covered %
alioth/src/virtio/vu/frontend.rs 13 0 0.0%
alioth/src/virtio/worker/io_uring.rs 12 0 0.0%
alioth/src/virtio/dev/vsock/vhost_vsock.rs 11 0 0.0%
alioth/src/virtio/dev/blk.rs 10 0 0.0%
alioth/src/virtio/dev/fs/vu.rs 10 0 0.0%
alioth/src/virtio/dev/net/tap.rs 10 0 0.0%
alioth/src/virtio/vu/backend.rs 9 0 0.0%
alioth/src/virtio/dev/balloon.rs 8 0 0.0%
alioth/src/virtio/dev/fs/fs.rs 8 0 0.0%
alioth/src/virtio/dev/net/vmnet.rs 8 0 0.0%
Total (20 files) 181 51 28.18%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 15379
Covered Lines: 5567
Line Coverage: 36.2%
Relevant Branches: 1552
Covered Branches: 753
Branch Coverage: 48.52%
Branches in Coverage %: Yes
Coverage Strength: 45.23 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants