@@ -173,7 +173,6 @@ pub struct Balloon {
173173 pub ( crate ) device_state : DeviceState ,
174174
175175 // Implementation specific fields.
176- pub ( crate ) restored_from_file : bool ,
177176 pub ( crate ) stats_polling_interval_s : u16 ,
178177 pub ( crate ) stats_timer : TimerFd ,
179178 // The index of the previous stats descriptor is saved because
@@ -190,7 +189,6 @@ impl Balloon {
190189 amount_mib : u32 ,
191190 deflate_on_oom : bool ,
192191 stats_polling_interval_s : u16 ,
193- restored_from_file : bool ,
194192 ) -> Result < Balloon , BalloonError > {
195193 let mut avail_features = 1u64 << VIRTIO_F_VERSION_1 ;
196194
@@ -230,7 +228,6 @@ impl Balloon {
230228 queues,
231229 device_state : DeviceState :: Inactive ,
232230 activate_evt : EventFd :: new ( libc:: EFD_NONBLOCK ) . map_err ( BalloonError :: EventFd ) ?,
233- restored_from_file,
234231 stats_polling_interval_s,
235232 stats_timer,
236233 stats_desc_index : None ,
@@ -740,7 +737,7 @@ pub(crate) mod tests {
740737 // Test all feature combinations.
741738 for deflate_on_oom in [ true , false ] . iter ( ) {
742739 for stats_interval in [ 0 , 1 ] . iter ( ) {
743- let mut balloon = Balloon :: new ( 0 , * deflate_on_oom, * stats_interval, false ) . unwrap ( ) ;
740+ let mut balloon = Balloon :: new ( 0 , * deflate_on_oom, * stats_interval) . unwrap ( ) ;
744741 assert_eq ! ( balloon. device_type( ) , VIRTIO_ID_BALLOON ) ;
745742
746743 let features: u64 = ( 1u64 << VIRTIO_F_VERSION_1 )
@@ -767,7 +764,7 @@ pub(crate) mod tests {
767764
768765 #[ test]
769766 fn test_virtio_read_config ( ) {
770- let balloon = Balloon :: new ( 0x10 , true , 0 , false ) . unwrap ( ) ;
767+ let balloon = Balloon :: new ( 0x10 , true , 0 ) . unwrap ( ) ;
771768
772769 let cfg = BalloonConfig {
773770 amount_mib : 16 ,
@@ -801,7 +798,7 @@ pub(crate) mod tests {
801798
802799 #[ test]
803800 fn test_virtio_write_config ( ) {
804- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
801+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
805802
806803 let expected_config_space: [ u8 ; BALLOON_CONFIG_SPACE_SIZE ] =
807804 [ 0x00 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ] ;
@@ -827,7 +824,7 @@ pub(crate) mod tests {
827824
828825 #[ test]
829826 fn test_invalid_request ( ) {
830- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
827+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
831828 let mem = default_mem ( ) ;
832829 let interrupt = default_interrupt ( ) ;
833830 // Only initialize the inflate queue to demonstrate invalid request handling.
@@ -888,7 +885,7 @@ pub(crate) mod tests {
888885
889886 #[ test]
890887 fn test_inflate ( ) {
891- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
888+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
892889 let mem = default_mem ( ) ;
893890 let interrupt = default_interrupt ( ) ;
894891 let infq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -960,7 +957,7 @@ pub(crate) mod tests {
960957
961958 #[ test]
962959 fn test_deflate ( ) {
963- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
960+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
964961 let mem = default_mem ( ) ;
965962 let interrupt = default_interrupt ( ) ;
966963 let defq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -1010,7 +1007,7 @@ pub(crate) mod tests {
10101007
10111008 #[ test]
10121009 fn test_stats ( ) {
1013- let mut balloon = Balloon :: new ( 0 , true , 1 , false ) . unwrap ( ) ;
1010+ let mut balloon = Balloon :: new ( 0 , true , 1 ) . unwrap ( ) ;
10141011 let mem = default_mem ( ) ;
10151012 let interrupt = default_interrupt ( ) ;
10161013 let statsq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -1102,7 +1099,7 @@ pub(crate) mod tests {
11021099
11031100 #[ test]
11041101 fn test_process_balloon_queues ( ) {
1105- let mut balloon = Balloon :: new ( 0x10 , true , 0 , false ) . unwrap ( ) ;
1102+ let mut balloon = Balloon :: new ( 0x10 , true , 0 ) . unwrap ( ) ;
11061103 let mem = default_mem ( ) ;
11071104 let interrupt = default_interrupt ( ) ;
11081105 let infq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -1117,7 +1114,7 @@ pub(crate) mod tests {
11171114
11181115 #[ test]
11191116 fn test_update_stats_interval ( ) {
1120- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
1117+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
11211118 let mem = default_mem ( ) ;
11221119 let q = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
11231120 balloon. set_queue ( INFLATE_INDEX , q. create_queue ( ) ) ;
@@ -1130,7 +1127,7 @@ pub(crate) mod tests {
11301127 ) ;
11311128 balloon. update_stats_polling_interval ( 0 ) . unwrap ( ) ;
11321129
1133- let mut balloon = Balloon :: new ( 0 , true , 1 , false ) . unwrap ( ) ;
1130+ let mut balloon = Balloon :: new ( 0 , true , 1 ) . unwrap ( ) ;
11341131 let mem = default_mem ( ) ;
11351132 let q = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
11361133 balloon. set_queue ( INFLATE_INDEX , q. create_queue ( ) ) ;
@@ -1148,14 +1145,14 @@ pub(crate) mod tests {
11481145
11491146 #[ test]
11501147 fn test_cannot_update_inactive_device ( ) {
1151- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
1148+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
11521149 // Assert that we can't update an inactive device.
11531150 balloon. update_size ( 1 ) . unwrap_err ( ) ;
11541151 }
11551152
11561153 #[ test]
11571154 fn test_num_pages ( ) {
1158- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
1155+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
11591156 // Switch the state to active.
11601157 balloon. device_state = DeviceState :: Activated ( ActiveState {
11611158 mem : single_region_mem ( 32 << 20 ) ,
0 commit comments