1
1
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
- use std:: fmt;
5
4
use std:: time:: Duration ;
6
5
7
6
use log:: error;
@@ -151,6 +150,7 @@ impl BalloonStats {
151
150
}
152
151
153
152
/// Virtio balloon device.
153
+ #[ derive( Debug ) ]
154
154
pub struct Balloon {
155
155
// Virtio fields.
156
156
pub ( crate ) avail_features : u64 ,
@@ -176,29 +176,6 @@ pub struct Balloon {
176
176
pub ( crate ) pfn_buffer : [ u32 ; MAX_PAGE_COMPACT_BUFFER ] ,
177
177
}
178
178
179
- // TODO Use `#[derive(Debug)]` when a new release of
180
- // [rust-timerfd](https://github.com/main--/rust-timerfd) is published that includes
181
- // https://github.com/main--/rust-timerfd/pull/12.
182
- impl fmt:: Debug for Balloon {
183
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
184
- f. debug_struct ( "Balloon" )
185
- . field ( "avail_features" , & self . avail_features )
186
- . field ( "acked_features" , & self . acked_features )
187
- . field ( "config_space" , & self . config_space )
188
- . field ( "activate_evt" , & self . activate_evt )
189
- . field ( "queues" , & self . queues )
190
- . field ( "queue_evts" , & self . queue_evts )
191
- . field ( "device_state" , & self . device_state )
192
- . field ( "irq_trigger" , & self . irq_trigger )
193
- . field ( "restored_from_file" , & self . restored_from_file )
194
- . field ( "stats_polling_interval_s" , & self . stats_polling_interval_s )
195
- . field ( "stats_desc_index" , & self . stats_desc_index )
196
- . field ( "latest_stats" , & self . latest_stats )
197
- . field ( "pfn_buffer" , & self . pfn_buffer )
198
- . finish ( )
199
- }
200
- }
201
-
202
179
impl Balloon {
203
180
/// Instantiate a new balloon device.
204
181
pub fn new (
0 commit comments