File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ pub struct DeviceStates {
199
199
/// Virtio block device states.
200
200
pub virtio_block_devices : Vec < ConnectedVirtioBlockState > ,
201
201
/// Vhost-user block device states.
202
+ #[ version( start = 5 , de_fn = "de_vhost_user_block" ) ]
202
203
pub vhost_user_block_devices : Vec < ConnectedVhostUserBlockState > ,
203
204
/// Net device states.
204
205
pub net_devices : Vec < ConnectedNetState > ,
@@ -258,6 +259,14 @@ impl DeviceStates {
258
259
259
260
Ok ( ( ) )
260
261
}
262
+
263
+ fn de_vhost_user_block ( & mut self , source_version : u16 ) -> VersionizeResult < ( ) > {
264
+ if source_version < 5 {
265
+ self . vhost_user_block_devices = vec ! [ ] ;
266
+ }
267
+
268
+ Ok ( ( ) )
269
+ }
261
270
}
262
271
263
272
pub struct MMIODevManagerConstructorArgs < ' a > {
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ lazy_static! {
86
86
version_map. new_version( ) ;
87
87
88
88
version_map. set_type_version( VirtioDeviceState :: type_id( ) , 2 ) ;
89
+ version_map. set_type_version( DeviceStates :: type_id( ) , 5 ) ;
89
90
90
91
version_map
91
92
} ;
You can’t perform that action at this time.
0 commit comments