@@ -22,7 +22,7 @@ use std::io::Result;
2222use  std:: ops:: Deref ; 
2323use  std:: sync:: { Arc ,  Mutex ,  RwLock } ; 
2424
25- use  vhost:: vhost_user:: message:: VhostUserProtocolFeatures ; 
25+ use  vhost:: vhost_user:: message:: { VhostUserBackendSpecs ,   VhostUserProtocolFeatures } ; 
2626use  vhost:: vhost_user:: Slave ; 
2727use  vm_memory:: bitmap:: Bitmap ; 
2828use  vmm_sys_util:: epoll:: EventSet ; 
5454    /// Get available vhost protocol features. 
5555fn  protocol_features ( & self )  -> VhostUserProtocolFeatures ; 
5656
57+     /// Get the backends specs 
58+ fn  specs ( & self )  -> VhostUserBackendSpecs ; 
59+ 
5760    /// Enable or disable the virtio EVENT_IDX feature 
5861fn  set_event_idx ( & self ,  enabled :  bool ) ; 
5962
@@ -135,6 +138,9 @@ where
135138    /// Get available vhost protocol features. 
136139fn  protocol_features ( & self )  -> VhostUserProtocolFeatures ; 
137140
141+     /// Get specs 
142+ fn  specs ( & self )  -> VhostUserBackendSpecs ; 
143+ 
138144    /// Enable or disable the virtio EVENT_IDX feature 
139145fn  set_event_idx ( & mut  self ,  enabled :  bool ) ; 
140146
@@ -220,6 +226,10 @@ where
220226        self . deref ( ) . protocol_features ( ) 
221227    } 
222228
229+     fn  specs ( & self )  -> VhostUserBackendSpecs  { 
230+         self . deref ( ) . specs ( ) 
231+     } 
232+ 
223233    fn  set_event_idx ( & self ,  enabled :  bool )  { 
224234        self . deref ( ) . set_event_idx ( enabled) 
225235    } 
@@ -285,6 +295,10 @@ where
285295        self . lock ( ) . unwrap ( ) . protocol_features ( ) 
286296    } 
287297
298+     fn  specs ( & self )  -> VhostUserBackendSpecs  { 
299+         self . lock ( ) . unwrap ( ) . specs ( ) 
300+     } 
301+ 
288302    fn  set_event_idx ( & self ,  enabled :  bool )  { 
289303        self . lock ( ) . unwrap ( ) . set_event_idx ( enabled) 
290304    } 
@@ -351,6 +365,10 @@ where
351365        self . read ( ) . unwrap ( ) . protocol_features ( ) 
352366    } 
353367
368+     fn  specs ( & self )  -> VhostUserBackendSpecs  { 
369+         self . read ( ) . unwrap ( ) . specs ( ) 
370+     } 
371+ 
354372    fn  set_event_idx ( & self ,  enabled :  bool )  { 
355373        self . write ( ) . unwrap ( ) . set_event_idx ( enabled) 
356374    } 
@@ -436,6 +454,10 @@ pub mod tests {
436454            VhostUserProtocolFeatures :: all ( ) 
437455        } 
438456
457+         fn  specs ( & self )  -> VhostUserBackendSpecs  { 
458+             VhostUserBackendSpecs :: new ( 2 ,  32 ,  4 ,  8 ) 
459+         } 
460+ 
439461        fn  set_event_idx ( & mut  self ,  enabled :  bool )  { 
440462            self . event_idx  = enabled; 
441463        } 
0 commit comments