-
Notifications
You must be signed in to change notification settings - Fork 86
Replace Eventfd with EventNotifier/EventConsumer #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@uran0sH marked as draft, since we need a new vmm-sys-util release before merging this. |
|
@uran0sH please rebase and check CI (come failures need the new rust version we are updating in the CI, but others are related to format, etc.) |
|
@uran0sH please check the CI, there some clippy warning to fix, but also some tests blocked for more than 60s. Should I restart the CI or it's an issue we need to fix? |
I think it's an issue |
27ee193 to
8f825e0
Compare
Fix this issue by changing this line to into_raw_fd() (https://github.com/rust-vmm/vhost/pull/308/files#diff-e1c9dc7802234bc118de8314ec9cacc98066eea325a6f14ff5887ece3466d5a3R96). Because when we use pipe, using as_raw_fd will cause the consumer's fd to be closed, like this (https://github.com/rust-vmm/vhost/pull/308/files#diff-c9eba2d5821720c1f7e164d0d01d85b14040d8f3200fac89607fdd1af09d5491R111). So we need to take the ownership of this fd. |
985bc12 to
3d0aee3
Compare
|
This pr(rust-vmm/vmm-sys-util#246) seems cause the ci failed: So I used the version before this PR was merged |
@uran0sH please open an issue ASAP on the project, we are preparing a release |
Yeah, see rust-vmm/vmm-sys-util#252 |
I think this is expected. Looking at the test, it's a negative test: and indeed, doing recv_with_fds with 0 fds when actually there are fds, causes linux to set MSG_CTRUNC and thus after #252 that is converted into an ENOBUFS (although on MacOS it'll work). |
ab09ddb to
bbff19a
Compare
germag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roypat @stefano-garzarella any thoughts?
Update to v0.15.0 which supports sock_ctrl_msg on POSIX and adds a cross platform event notification that uses EventFd when available or pipe(). Because sock_ctrl_msg modifies the recv_with_fds, we need to modify the test in vhost/src/vhost-user/connection.rs at the same time Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
Eventfd is Linux-specific. To support more platforms, we replace it with the EventNotifier/EventConsumer abstractions. EventSender and EventReceiver are wrappers that encapsulate eventfd functionality Use pipefd to replace eventfd in the test. Signed-off-by: Wenyu Huang <huangwenyuu@outlook.com>
bbff19a to
d983268
Compare
Summary of the PR
Eventfd is Linux-specific. To support more platforms, we replace it with
the EventNotifier/EventConsumer abstractions.
EventSender and EventReceiver are wrappers that encapsulate eventfd functionality
Use pipefd to replace eventfd in the test.
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafecode is properly documented.