@@ -29,14 +29,15 @@ use vhost::vhost_user::message::{
2929} ;
3030use vhost:: vhost_user:: Backend ;
3131use vm_memory:: bitmap:: Bitmap ;
32- use vmm_sys_util:: epoll:: EventSet ;
3332use vmm_sys_util:: event:: { EventConsumer , EventNotifier } ;
3433
3534use vhost:: vhost_user:: GpuBackend ;
3635
3736use super :: vring:: VringT ;
3837use super :: GM ;
3938
39+ use crate :: EventSet ;
40+
4041/// Trait with interior mutability for vhost user backend servers to implement concrete services.
4142///
4243/// To support multi-threading and asynchronous IO, we enforce `Send + Sync` bound.
@@ -144,7 +145,7 @@ pub trait VhostUserBackend: Send + Sync {
144145 /// do with events happening on custom listeners.
145146 fn handle_event (
146147 & self ,
147- device_event : u16 ,
148+ device_event : usize ,
148149 evset : EventSet ,
149150 vrings : & [ Self :: Vring ] ,
150151 thread_id : usize ,
@@ -288,7 +289,7 @@ pub trait VhostUserBackendMut: Send + Sync {
288289 /// do with events happening on custom listeners.
289290 fn handle_event (
290291 & mut self ,
291- device_event : u16 ,
292+ device_event : usize ,
292293 evset : EventSet ,
293294 vrings : & [ Self :: Vring ] ,
294295 thread_id : usize ,
@@ -390,7 +391,7 @@ impl<T: VhostUserBackend> VhostUserBackend for Arc<T> {
390391
391392 fn handle_event (
392393 & self ,
393- device_event : u16 ,
394+ device_event : usize ,
394395 evset : EventSet ,
395396 vrings : & [ Self :: Vring ] ,
396397 thread_id : usize ,
@@ -479,7 +480,7 @@ impl<T: VhostUserBackendMut> VhostUserBackend for Mutex<T> {
479480
480481 fn handle_event (
481482 & self ,
482- device_event : u16 ,
483+ device_event : usize ,
483484 evset : EventSet ,
484485 vrings : & [ Self :: Vring ] ,
485486 thread_id : usize ,
@@ -571,7 +572,7 @@ impl<T: VhostUserBackendMut> VhostUserBackend for RwLock<T> {
571572
572573 fn handle_event (
573574 & self ,
574- device_event : u16 ,
575+ device_event : usize ,
575576 evset : EventSet ,
576577 vrings : & [ Self :: Vring ] ,
577578 thread_id : usize ,
@@ -711,7 +712,7 @@ pub mod tests {
711712
712713 fn handle_event (
713714 & mut self ,
714- _device_event : u16 ,
715+ _device_event : usize ,
715716 _evset : EventSet ,
716717 _vrings : & [ VringRwLock ] ,
717718 _thread_id : usize ,
@@ -798,7 +799,7 @@ pub mod tests {
798799
799800 let vring = VringRwLock :: new ( mem, 0x1000 ) . unwrap ( ) ;
800801 backend
801- . handle_event ( 0x1 , EventSet :: IN , & [ vring] , 0 )
802+ . handle_event ( 0x1 , EventSet :: Readable , & [ vring] , 0 )
802803 . unwrap ( ) ;
803804
804805 backend. reset_device ( ) ;
0 commit comments