@@ -22,7 +22,7 @@ use std::io::Result;
22
22
use std:: ops:: Deref ;
23
23
use std:: sync:: { Arc , Mutex , RwLock } ;
24
24
25
- use vhost:: vhost_user:: message:: VhostUserProtocolFeatures ;
25
+ use vhost:: vhost_user:: message:: { VhostUserBackendSpecs , VhostUserProtocolFeatures } ;
26
26
use vhost:: vhost_user:: Slave ;
27
27
use vm_memory:: bitmap:: Bitmap ;
28
28
use vmm_sys_util:: epoll:: EventSet ;
54
54
/// Get available vhost protocol features.
55
55
fn protocol_features ( & self ) -> VhostUserProtocolFeatures ;
56
56
57
+ /// Get the backends specs
58
+ fn specs ( & self ) -> VhostUserBackendSpecs ;
59
+
57
60
/// Enable or disable the virtio EVENT_IDX feature
58
61
fn set_event_idx ( & self , enabled : bool ) ;
59
62
@@ -135,6 +138,9 @@ where
135
138
/// Get available vhost protocol features.
136
139
fn protocol_features ( & self ) -> VhostUserProtocolFeatures ;
137
140
141
+ /// Get specs
142
+ fn specs ( & self ) -> VhostUserBackendSpecs ;
143
+
138
144
/// Enable or disable the virtio EVENT_IDX feature
139
145
fn set_event_idx ( & mut self , enabled : bool ) ;
140
146
@@ -220,6 +226,10 @@ where
220
226
self . deref ( ) . protocol_features ( )
221
227
}
222
228
229
+ fn specs ( & self ) -> VhostUserBackendSpecs {
230
+ self . deref ( ) . specs ( )
231
+ }
232
+
223
233
fn set_event_idx ( & self , enabled : bool ) {
224
234
self . deref ( ) . set_event_idx ( enabled)
225
235
}
@@ -285,6 +295,10 @@ where
285
295
self . lock ( ) . unwrap ( ) . protocol_features ( )
286
296
}
287
297
298
+ fn specs ( & self ) -> VhostUserBackendSpecs {
299
+ self . lock ( ) . unwrap ( ) . specs ( )
300
+ }
301
+
288
302
fn set_event_idx ( & self , enabled : bool ) {
289
303
self . lock ( ) . unwrap ( ) . set_event_idx ( enabled)
290
304
}
@@ -351,6 +365,10 @@ where
351
365
self . read ( ) . unwrap ( ) . protocol_features ( )
352
366
}
353
367
368
+ fn specs ( & self ) -> VhostUserBackendSpecs {
369
+ self . read ( ) . unwrap ( ) . specs ( )
370
+ }
371
+
354
372
fn set_event_idx ( & self , enabled : bool ) {
355
373
self . write ( ) . unwrap ( ) . set_event_idx ( enabled)
356
374
}
@@ -436,6 +454,10 @@ pub mod tests {
436
454
VhostUserProtocolFeatures :: all ( )
437
455
}
438
456
457
+ fn specs ( & self ) -> VhostUserBackendSpecs {
458
+ VhostUserBackendSpecs :: new ( 2 , 32 , 4 , 8 )
459
+ }
460
+
439
461
fn set_event_idx ( & mut self , enabled : bool ) {
440
462
self . event_idx = enabled;
441
463
}
0 commit comments