@@ -173,7 +173,6 @@ pub struct Balloon {
173
173
pub ( crate ) device_state : DeviceState ,
174
174
175
175
// Implementation specific fields.
176
- pub ( crate ) restored_from_file : bool ,
177
176
pub ( crate ) stats_polling_interval_s : u16 ,
178
177
pub ( crate ) stats_timer : TimerFd ,
179
178
// The index of the previous stats descriptor is saved because
@@ -190,7 +189,6 @@ impl Balloon {
190
189
amount_mib : u32 ,
191
190
deflate_on_oom : bool ,
192
191
stats_polling_interval_s : u16 ,
193
- restored_from_file : bool ,
194
192
) -> Result < Balloon , BalloonError > {
195
193
let mut avail_features = 1u64 << VIRTIO_F_VERSION_1 ;
196
194
@@ -230,7 +228,6 @@ impl Balloon {
230
228
queues,
231
229
device_state : DeviceState :: Inactive ,
232
230
activate_evt : EventFd :: new ( libc:: EFD_NONBLOCK ) . map_err ( BalloonError :: EventFd ) ?,
233
- restored_from_file,
234
231
stats_polling_interval_s,
235
232
stats_timer,
236
233
stats_desc_index : None ,
@@ -740,7 +737,7 @@ pub(crate) mod tests {
740
737
// Test all feature combinations.
741
738
for deflate_on_oom in [ true , false ] . iter ( ) {
742
739
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 ( ) ;
744
741
assert_eq ! ( balloon. device_type( ) , VIRTIO_ID_BALLOON ) ;
745
742
746
743
let features: u64 = ( 1u64 << VIRTIO_F_VERSION_1 )
@@ -767,7 +764,7 @@ pub(crate) mod tests {
767
764
768
765
#[ test]
769
766
fn test_virtio_read_config ( ) {
770
- let balloon = Balloon :: new ( 0x10 , true , 0 , false ) . unwrap ( ) ;
767
+ let balloon = Balloon :: new ( 0x10 , true , 0 ) . unwrap ( ) ;
771
768
772
769
let cfg = BalloonConfig {
773
770
amount_mib : 16 ,
@@ -801,7 +798,7 @@ pub(crate) mod tests {
801
798
802
799
#[ test]
803
800
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 ( ) ;
805
802
806
803
let expected_config_space: [ u8 ; BALLOON_CONFIG_SPACE_SIZE ] =
807
804
[ 0x00 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ] ;
@@ -827,7 +824,7 @@ pub(crate) mod tests {
827
824
828
825
#[ test]
829
826
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 ( ) ;
831
828
let mem = default_mem ( ) ;
832
829
let interrupt = default_interrupt ( ) ;
833
830
// Only initialize the inflate queue to demonstrate invalid request handling.
@@ -888,7 +885,7 @@ pub(crate) mod tests {
888
885
889
886
#[ test]
890
887
fn test_inflate ( ) {
891
- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
888
+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
892
889
let mem = default_mem ( ) ;
893
890
let interrupt = default_interrupt ( ) ;
894
891
let infq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -960,7 +957,7 @@ pub(crate) mod tests {
960
957
961
958
#[ test]
962
959
fn test_deflate ( ) {
963
- let mut balloon = Balloon :: new ( 0 , true , 0 , false ) . unwrap ( ) ;
960
+ let mut balloon = Balloon :: new ( 0 , true , 0 ) . unwrap ( ) ;
964
961
let mem = default_mem ( ) ;
965
962
let interrupt = default_interrupt ( ) ;
966
963
let defq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -1010,7 +1007,7 @@ pub(crate) mod tests {
1010
1007
1011
1008
#[ test]
1012
1009
fn test_stats ( ) {
1013
- let mut balloon = Balloon :: new ( 0 , true , 1 , false ) . unwrap ( ) ;
1010
+ let mut balloon = Balloon :: new ( 0 , true , 1 ) . unwrap ( ) ;
1014
1011
let mem = default_mem ( ) ;
1015
1012
let interrupt = default_interrupt ( ) ;
1016
1013
let statsq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -1102,7 +1099,7 @@ pub(crate) mod tests {
1102
1099
1103
1100
#[ test]
1104
1101
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 ( ) ;
1106
1103
let mem = default_mem ( ) ;
1107
1104
let interrupt = default_interrupt ( ) ;
1108
1105
let infq = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
@@ -1117,7 +1114,7 @@ pub(crate) mod tests {
1117
1114
1118
1115
#[ test]
1119
1116
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 ( ) ;
1121
1118
let mem = default_mem ( ) ;
1122
1119
let q = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
1123
1120
balloon. set_queue ( INFLATE_INDEX , q. create_queue ( ) ) ;
@@ -1130,7 +1127,7 @@ pub(crate) mod tests {
1130
1127
) ;
1131
1128
balloon. update_stats_polling_interval ( 0 ) . unwrap ( ) ;
1132
1129
1133
- let mut balloon = Balloon :: new ( 0 , true , 1 , false ) . unwrap ( ) ;
1130
+ let mut balloon = Balloon :: new ( 0 , true , 1 ) . unwrap ( ) ;
1134
1131
let mem = default_mem ( ) ;
1135
1132
let q = VirtQueue :: new ( GuestAddress ( 0 ) , & mem, 16 ) ;
1136
1133
balloon. set_queue ( INFLATE_INDEX , q. create_queue ( ) ) ;
@@ -1148,14 +1145,14 @@ pub(crate) mod tests {
1148
1145
1149
1146
#[ test]
1150
1147
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 ( ) ;
1152
1149
// Assert that we can't update an inactive device.
1153
1150
balloon. update_size ( 1 ) . unwrap_err ( ) ;
1154
1151
}
1155
1152
1156
1153
#[ test]
1157
1154
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 ( ) ;
1159
1156
// Switch the state to active.
1160
1157
balloon. device_state = DeviceState :: Activated ( ActiveState {
1161
1158
mem : single_region_mem ( 32 << 20 ) ,
0 commit comments