vm_control: fix more wildcard re-exports

Import balloon_control items directly from that crate rather than via
re-exports from vm_control.

This fixes the fuzzer build, which depended on an implicitly imported
type via one of the conditional wildcard imports.

BUG=chromium:69590
TEST=(cd fuzz; cargo build)

Change-Id: I97d5df66741cfb64f600bebd503b73d779888440
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5630345
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2024-06-13 10:51:15 -07:00 committed by crosvm LUCI
parent 3a56ce02f2
commit ba06509a5c
5 changed files with 18 additions and 15 deletions

1
Cargo.lock generated
View file

@ -891,6 +891,7 @@ name = "crosvm_control"
version = "0.1.0"
dependencies = [
"anyhow",
"balloon_control",
"base",
"cbindgen",
"cc",

View file

@ -12,6 +12,7 @@ registered_events = ["vm_control/registered_events"]
crate-type = ["cdylib", "staticlib"]
[dependencies]
balloon_control = { path = "../common/balloon_control" }
base = { path = "../base" }
libc = "0.2.65"
swap = { path = "../swap", default-features = false }

View file

@ -27,6 +27,9 @@ use std::path::Path;
use std::path::PathBuf;
use std::time::Duration;
use balloon_control::BalloonStats;
use balloon_control::BalloonWS;
use balloon_control::WSBucket;
use libc::c_char;
use libc::ssize_t;
pub use swap::SwapStatus;
@ -41,8 +44,6 @@ use vm_control::client::handle_request;
use vm_control::client::handle_request_with_timeout;
use vm_control::client::vms_request;
use vm_control::BalloonControlCommand;
use vm_control::BalloonStats;
use vm_control::BalloonWS;
use vm_control::DiskControlCommand;
use vm_control::RegisteredEvent;
use vm_control::SwapCommand;
@ -50,7 +51,6 @@ use vm_control::UsbControlAttachedDevice;
use vm_control::UsbControlResult;
use vm_control::VmRequest;
use vm_control::VmResponse;
use vm_control::WSBucket;
use vm_control::USB_CONTROL_MAX_PORTS;
pub const VIRTIO_BALLOON_WS_MAX_NUM_BINS: usize = 16;

View file

@ -9,13 +9,8 @@ use std::collections::VecDeque;
use anyhow::bail;
use anyhow::Context;
use anyhow::Result;
pub use balloon_control::BalloonStats;
use balloon_control::BalloonTubeCommand;
pub use balloon_control::BalloonTubeResult;
pub use balloon_control::BalloonWS;
pub use balloon_control::WSBucket;
pub use balloon_control::VIRTIO_BALLOON_WS_MAX_NUM_BINS;
pub use balloon_control::VIRTIO_BALLOON_WS_MIN_NUM_BINS;
use balloon_control::BalloonTubeResult;
use base::error;
use base::Error as SysError;
use base::Tube;
@ -94,7 +89,6 @@ pub struct BalloonTube {
pending_adjust_with_completion: Option<(u64, usize)>,
}
#[cfg(feature = "balloon")]
impl BalloonTube {
pub fn new(tube: Tube) -> Self {
BalloonTube {
@ -211,6 +205,8 @@ impl BalloonTube {
#[cfg(test)]
mod tests {
use balloon_control::BalloonStats;
use super::*;
fn balloon_device_respond_stats(device: &Tube) {

View file

@ -110,7 +110,9 @@ pub use vm_control_product::ServiceSendToGpu;
use vm_memory::GuestAddress;
#[cfg(feature = "balloon")]
pub use crate::balloon_tube::*;
pub use crate::balloon_tube::BalloonControlCommand;
#[cfg(feature = "balloon")]
pub use crate::balloon_tube::BalloonTube;
#[cfg(feature = "gdb")]
pub use crate::gdb::VcpuDebug;
#[cfg(feature = "gdb")]
@ -1366,7 +1368,7 @@ pub enum RegisteredEvent {
#[derive(Serialize, Deserialize, Debug)]
pub enum RegisteredEventWithData {
VirtioBalloonWsReport {
ws_buckets: Vec<WSBucket>,
ws_buckets: Vec<balloon_control::WSBucket>,
balloon_actual: u64,
},
VirtioBalloonResize,
@ -1418,7 +1420,7 @@ impl RegisteredEventWithData {
}
}
pub fn from_ws(ws: &BalloonWS, balloon_actual: u64) -> Self {
pub fn from_ws(ws: &balloon_control::BalloonWS, balloon_actual: u64) -> Self {
RegisteredEventWithData::VirtioBalloonWsReport {
ws_buckets: ws.ws.clone(),
balloon_actual,
@ -2233,12 +2235,15 @@ pub enum VmResponse {
/// Results of balloon control commands.
#[cfg(feature = "balloon")]
BalloonStats {
stats: BalloonStats,
stats: balloon_control::BalloonStats,
balloon_actual: u64,
},
/// Results of balloon WS-R command
#[cfg(feature = "balloon")]
BalloonWS { ws: BalloonWS, balloon_actual: u64 },
BalloonWS {
ws: balloon_control::BalloonWS,
balloon_actual: u64,
},
/// Results of PCI hot plug
#[cfg(feature = "pci-hotplug")]
PciHotPlugResponse { bus: u8 },