Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions src/vmm/src/devices/virtio/balloon/device.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

use std::fmt;
use std::time::Duration;

use log::error;
Expand Down Expand Up @@ -151,6 +150,7 @@ impl BalloonStats {
}

/// Virtio balloon device.
#[derive(Debug)]
pub struct Balloon {
// Virtio fields.
pub(crate) avail_features: u64,
Expand All @@ -176,29 +176,6 @@ pub struct Balloon {
pub(crate) pfn_buffer: [u32; MAX_PAGE_COMPACT_BUFFER],
}

// TODO Use `#[derive(Debug)]` when a new release of
// [rust-timerfd](https://github.com/main--/rust-timerfd) is published that includes
// https://github.com/main--/rust-timerfd/pull/12.
impl fmt::Debug for Balloon {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Balloon")
.field("avail_features", &self.avail_features)
.field("acked_features", &self.acked_features)
.field("config_space", &self.config_space)
.field("activate_evt", &self.activate_evt)
.field("queues", &self.queues)
.field("queue_evts", &self.queue_evts)
.field("device_state", &self.device_state)
.field("irq_trigger", &self.irq_trigger)
.field("restored_from_file", &self.restored_from_file)
.field("stats_polling_interval_s", &self.stats_polling_interval_s)
.field("stats_desc_index", &self.stats_desc_index)
.field("latest_stats", &self.latest_stats)
.field("pfn_buffer", &self.pfn_buffer)
.finish()
}
}

impl Balloon {
/// Instantiate a new balloon device.
pub fn new(
Expand Down