-
Notifications
You must be signed in to change notification settings - Fork 110
Add virtio-input device and implement input support in the reference implementation #415
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
base: main
Are you sure you want to change the base?
Conversation
febeffb
to
9b74ac8
Compare
We were using VecDeque::pop instead of ::pop_front like inteded, oops. Signed-off-by: Matej Hrica <[email protected]>
Previously we only provided RawFd. Signed-off-by: Matej Hrica <[email protected]>
The device can be configured using 2 vtables one providing the callbacks for querying configuration parameters of the device and other vtable for delivering the actual input events. Signed-off-by: Matej Hrica <[email protected]>
Introduce krun_add_input_device_fd, allowing the user to pass a file descriptor to a /dev/input/event* device, which will be become available in the guest. Signed-off-by: Matej Hrica <[email protected]>
The send_many method is more convinient, should be more efficient and can also be more robust - all of the messages are sent atomically. Signed-off-by: Matej Hrica <[email protected]>
Signed-off-by: Matej Hrica <[email protected]>
6be8b3e
to
a35dad4
Compare
Signed-off-by: Matej Hrica <[email protected]>
Signed-off-by: Matej Hrica <[email protected]>
a35dad4
to
61339f0
Compare
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.
LGTM in general, just a couple of minor issues. Also, please add a license header to the new files.
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.
Please drop this binary.
device_state: DeviceState::Inactive, | ||
cfg: InputConfig::new(), | ||
worker_thread: None, | ||
worker_stopfd: EventFd::new(libc::EFD_NONBLOCK).map_err(InputError::EventFd)?, |
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.
Please use utils::eventfd::EFD_NONBLOCK
This PR adds a generic
virtio-input
device, that can be used either by specifying a callbacks for configuring the device and generating input events, or by forwarding a/dev/input/event*
.This also hooks up the functionality for
gui_vm
example (keyboard and touchscreen).