Skip to content

epoll to mio migration#362

Open
eric-14 wants to merge 7 commits into
rust-vmm:mainfrom
eric-14:pr-316
Open

epoll to mio migration#362
eric-14 wants to merge 7 commits into
rust-vmm:mainfrom
eric-14:pr-316

Conversation

@eric-14

@eric-14 eric-14 commented Jul 3, 2026

Copy link
Copy Markdown

Summary of the PR

Epoll is linux specific. To support unix systems this PR changes I/O support to mio.

PR is also a continuation of #316.

The PR completes the work needed to move from epoll to mio.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

[ x ] All commits in this PR have Signed-Off-By trailers (with
git commit -s), and the commit message has max 60 characters for the
summary and max 75 characters for each description line.
[ x ] All added/changed functionality has a corresponding unit/integration
test.
[ x ] All added/changed public-facing functionality has entries in the "Upcoming
Release" section of CHANGELOG.md (if no such section exists, please create one).
[ x ] Any newly added unsafe code is properly documented.

uran0sH and others added 7 commits July 3, 2026 18:27
When register_event we pass in the value of u32/u64, so we don't
need to convert it to u16 and then pass it to handle_event.

Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
We can safely use usize instead of u64, because normally we will
not register a data that exceeds the size of usize

Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
Epoll is linux-specific. So we use mio, which is a cross-platform
event notification, to replace Epoll.

Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
change the logging od undefined events in vring are logged using `println!`
to `log::warn!`.

Signed-off-by: EricMwangi <ericmwas01@gmail.com>
Rename the generic third paremeter in un/register_listener to `queue_idx`.
This explicitly describes the function of the parameter.

Signed-off-by: EricMwangi <ericmwas01@gmail.com>
Add is_error,is_read_closed and is_write_closed to exhaust states of event.
This provides better clarity into the state of events.

Signed-off-by: EricMwangi <ericmwas01@gmail.com>
Modify `VringPollHandler` to pass `&mut Poll` to `run`, removing the
need for a Mutex wrapper around Poller. This simplifies compliance
with the `Send` + `Sync` requirements of `VringPollHandler` and
removes false implications of multithreaded safety.

Signed-off-by: EricMwangi <ericmwas01@gmail.com>
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