mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Make EpollHandler more generic
Instead of passing only the event type through the handle_event() callback, we make the trait slightly more generic by providing the epoll event to each virtio device implementation. This is particularly useful for vsock as it will need the event set. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
1e0b516a84
commit
01e7bd7276
@@ -160,8 +160,9 @@ impl NetEpollHandler {
|
||||
}
|
||||
|
||||
impl EpollHelperHandler for NetEpollHandler {
|
||||
fn handle_event(&mut self, _helper: &mut EpollHelper, event: u16) -> bool {
|
||||
match event {
|
||||
fn handle_event(&mut self, _helper: &mut EpollHelper, event: &epoll::Event) -> bool {
|
||||
let ev_type = event.data as u16;
|
||||
match ev_type {
|
||||
RX_QUEUE_EVENT => {
|
||||
self.driver_awake = true;
|
||||
if let Err(e) = self.handle_rx_event() {
|
||||
@@ -183,7 +184,7 @@ impl EpollHelperHandler for NetEpollHandler {
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
error!("Unknown event: {}", event);
|
||||
error!("Unknown event: {}", ev_type);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user