11// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22// SPDX-License-Identifier: Apache-2.0
33
4- use std:: fmt;
54use std:: time:: Duration ;
65
76use log:: error;
@@ -151,6 +150,7 @@ impl BalloonStats {
151150}
152151
153152/// Virtio balloon device.
153+ #[ derive( Debug ) ]
154154pub struct Balloon {
155155 // Virtio fields.
156156 pub ( crate ) avail_features : u64 ,
@@ -176,29 +176,6 @@ pub struct Balloon {
176176 pub ( crate ) pfn_buffer : [ u32 ; MAX_PAGE_COMPACT_BUFFER ] ,
177177}
178178
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-
202179impl Balloon {
203180 /// Instantiate a new balloon device.
204181 pub fn new (
0 commit comments