@@ -29,14 +29,15 @@ use vhost::vhost_user::message::{
29
29
} ;
30
30
use vhost:: vhost_user:: Backend ;
31
31
use vm_memory:: bitmap:: Bitmap ;
32
- use vmm_sys_util:: epoll:: EventSet ;
33
32
use vmm_sys_util:: event:: { EventConsumer , EventNotifier } ;
34
33
35
34
use vhost:: vhost_user:: GpuBackend ;
36
35
37
36
use super :: vring:: VringT ;
38
37
use super :: GM ;
39
38
39
+ use crate :: EventSet ;
40
+
40
41
/// Trait with interior mutability for vhost user backend servers to implement concrete services.
41
42
///
42
43
/// To support multi-threading and asynchronous IO, we enforce `Send + Sync` bound.
@@ -144,7 +145,7 @@ pub trait VhostUserBackend: Send + Sync {
144
145
/// do with events happening on custom listeners.
145
146
fn handle_event (
146
147
& self ,
147
- device_event : u16 ,
148
+ device_event : usize ,
148
149
evset : EventSet ,
149
150
vrings : & [ Self :: Vring ] ,
150
151
thread_id : usize ,
@@ -288,7 +289,7 @@ pub trait VhostUserBackendMut: Send + Sync {
288
289
/// do with events happening on custom listeners.
289
290
fn handle_event (
290
291
& mut self ,
291
- device_event : u16 ,
292
+ device_event : usize ,
292
293
evset : EventSet ,
293
294
vrings : & [ Self :: Vring ] ,
294
295
thread_id : usize ,
@@ -390,7 +391,7 @@ impl<T: VhostUserBackend> VhostUserBackend for Arc<T> {
390
391
391
392
fn handle_event (
392
393
& self ,
393
- device_event : u16 ,
394
+ device_event : usize ,
394
395
evset : EventSet ,
395
396
vrings : & [ Self :: Vring ] ,
396
397
thread_id : usize ,
@@ -479,7 +480,7 @@ impl<T: VhostUserBackendMut> VhostUserBackend for Mutex<T> {
479
480
480
481
fn handle_event (
481
482
& self ,
482
- device_event : u16 ,
483
+ device_event : usize ,
483
484
evset : EventSet ,
484
485
vrings : & [ Self :: Vring ] ,
485
486
thread_id : usize ,
@@ -571,7 +572,7 @@ impl<T: VhostUserBackendMut> VhostUserBackend for RwLock<T> {
571
572
572
573
fn handle_event (
573
574
& self ,
574
- device_event : u16 ,
575
+ device_event : usize ,
575
576
evset : EventSet ,
576
577
vrings : & [ Self :: Vring ] ,
577
578
thread_id : usize ,
@@ -711,7 +712,7 @@ pub mod tests {
711
712
712
713
fn handle_event (
713
714
& mut self ,
714
- _device_event : u16 ,
715
+ _device_event : usize ,
715
716
_evset : EventSet ,
716
717
_vrings : & [ VringRwLock ] ,
717
718
_thread_id : usize ,
@@ -798,7 +799,7 @@ pub mod tests {
798
799
799
800
let vring = VringRwLock :: new ( mem, 0x1000 ) . unwrap ( ) ;
800
801
backend
801
- . handle_event ( 0x1 , EventSet :: IN , & [ vring] , 0 )
802
+ . handle_event ( 0x1 , EventSet :: Readable , & [ vring] , 0 )
802
803
. unwrap ( ) ;
803
804
804
805
backend. reset_device ( ) ;
0 commit comments