From adb318f4cd0079246b3cb07e01c4e978330445d2 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Mon, 19 Feb 2024 16:37:15 +0000 Subject: [PATCH] misc: Remove redundant "use" imports With the nightly toolchain (2024-02-18) cargo check will flag up redundant imports either because they are pulled in by the prelude on earlier match. Remove those redundant imports. Signed-off-by: Rob Bradford --- arch/src/x86_64/mptable.rs | 3 +-- arch/src/x86_64/regs.rs | 1 - block/src/lib.rs | 1 - block/src/qcow/mod.rs | 1 - block/src/qcow/raw_file.rs | 1 - block/src/vhd.rs | 1 - block/src/vhdx/vhdx_header.rs | 1 - devices/src/legacy/serial.rs | 3 +-- .../src/arch/x86/emulator/instructions/cmp.rs | 2 -- .../src/arch/x86/emulator/instructions/mov.rs | 2 -- .../src/arch/x86/emulator/instructions/movs.rs | 2 -- hypervisor/src/arch/x86/emulator/instructions/or.rs | 2 -- hypervisor/src/arch/x86/emulator/mod.rs | 4 +--- net_util/src/mac.rs | 1 - pci/src/device.rs | 2 +- performance-metrics/src/performance_tests.rs | 1 - rate_limiter/src/lib.rs | 1 - src/main.rs | 1 - tpm/src/emulator.rs | 1 - tpm/src/lib.rs | 1 - vhost_user_block/src/lib.rs | 1 - vhost_user_net/src/lib.rs | 3 +-- virtio-devices/src/block.rs | 2 +- virtio-devices/src/lib.rs | 1 - virtio-devices/src/net.rs | 3 +-- virtio-devices/src/seccomp_filters.rs | 1 - virtio-devices/src/transport/pci_common_config.rs | 2 -- virtio-devices/src/vhost_user/blk.rs | 1 - virtio-devices/src/vhost_user/fs.rs | 2 +- virtio-devices/src/vhost_user/net.rs | 1 - virtio-devices/src/vhost_user/vu_common_ctrl.rs | 1 - virtio-devices/src/vsock/csm/connection.rs | 13 ++++--------- virtio-devices/src/vsock/csm/txbuf.rs | 2 +- virtio-devices/src/vsock/device.rs | 1 - virtio-devices/src/vsock/unix/muxer.rs | 10 +++------- vm-device/src/bus.rs | 2 +- vmm/src/config.rs | 1 - vmm/src/lib.rs | 2 +- vmm/src/memory_manager.rs | 1 - vmm/src/pci_segment.rs | 2 +- vmm/src/seccomp_filters.rs | 1 - vmm/src/vm.rs | 1 - 42 files changed, 19 insertions(+), 67 deletions(-) diff --git a/arch/src/x86_64/mptable.rs b/arch/src/x86_64/mptable.rs index 38c425b2f..a6bc2ba3e 100644 --- a/arch/src/x86_64/mptable.rs +++ b/arch/src/x86_64/mptable.rs @@ -300,8 +300,7 @@ mod tests { use super::*; use crate::layout::MPTABLE_START; use vm_memory::{ - bitmap::BitmapSlice, GuestAddress, GuestUsize, VolatileMemoryError, VolatileSlice, - WriteVolatile, + bitmap::BitmapSlice, GuestUsize, VolatileMemoryError, VolatileSlice, WriteVolatile, }; fn table_entry_size(type_: u8) -> usize { diff --git a/arch/src/x86_64/regs.rs b/arch/src/x86_64/regs.rs index b9a360dc2..16db5621c 100644 --- a/arch/src/x86_64/regs.rs +++ b/arch/src/x86_64/regs.rs @@ -175,7 +175,6 @@ pub fn configure_segments_and_sregs( #[cfg(test)] mod tests { use super::*; - use crate::GuestMemoryMmap; use vm_memory::GuestAddress; fn create_guest_mem() -> GuestMemoryMmap { diff --git a/block/src/lib.rs b/block/src/lib.rs index 1a7e1a9de..a5d22dcce 100644 --- a/block/src/lib.rs +++ b/block/src/lib.rs @@ -41,7 +41,6 @@ use smallvec::SmallVec; use std::alloc::{alloc_zeroed, dealloc, Layout}; use std::cmp; use std::collections::VecDeque; -use std::convert::TryInto; use std::fmt::Debug; use std::fs::File; use std::io::{self, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write}; diff --git a/block/src/qcow/mod.rs b/block/src/qcow/mod.rs index 264244c27..66bb0405f 100644 --- a/block/src/qcow/mod.rs +++ b/block/src/qcow/mod.rs @@ -1822,7 +1822,6 @@ pub fn detect_image_type(file: &mut RawFile) -> Result { #[cfg(test)] mod tests { use super::*; - use std::io::{Read, Seek, SeekFrom, Write}; use vmm_sys_util::tempfile::TempFile; use vmm_sys_util::write_zeroes::WriteZeroes; diff --git a/block/src/qcow/raw_file.rs b/block/src/qcow/raw_file.rs index b1b7ebc7f..d95ba6f5c 100644 --- a/block/src/qcow/raw_file.rs +++ b/block/src/qcow/raw_file.rs @@ -11,7 +11,6 @@ use crate::BlockBackend; use libc::c_void; use std::alloc::{alloc_zeroed, dealloc, Layout}; -use std::convert::TryInto; use std::fs::{File, Metadata}; use std::io::{self, Read, Seek, SeekFrom, Write}; use std::os::unix::io::{AsRawFd, RawFd}; diff --git a/block/src/vhd.rs b/block/src/vhd.rs index 2bf99a05c..ad9a90dca 100644 --- a/block/src/vhd.rs +++ b/block/src/vhd.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: Apache-2.0 use crate::{read_aligned_block_size, DiskTopology}; -use std::convert::TryInto; use std::fs::File; use std::io::{Seek, SeekFrom}; diff --git a/block/src/vhdx/vhdx_header.rs b/block/src/vhdx/vhdx_header.rs index 84c5acd2b..b21f7a0c2 100644 --- a/block/src/vhdx/vhdx_header.rs +++ b/block/src/vhdx/vhdx_header.rs @@ -7,7 +7,6 @@ extern crate log; use byteorder::{ByteOrder, LittleEndian, ReadBytesExt}; use remain::sorted; use std::collections::btree_map::BTreeMap; -use std::convert::TryInto; use std::fs::File; use std::io::{self, Read, Seek, SeekFrom, Write}; use std::mem::size_of; diff --git a/devices/src/legacy/serial.rs b/devices/src/legacy/serial.rs index 0f2bceea4..d3cc12e19 100644 --- a/devices/src/legacy/serial.rs +++ b/devices/src/legacy/serial.rs @@ -345,8 +345,7 @@ impl Migratable for Serial {} #[cfg(test)] mod tests { use super::*; - use std::io; - use std::sync::{Arc, Mutex}; + use std::sync::Mutex; use vm_device::interrupt::{InterruptIndex, InterruptSourceConfig}; use vmm_sys_util::eventfd::EventFd; diff --git a/hypervisor/src/arch/x86/emulator/instructions/cmp.rs b/hypervisor/src/arch/x86/emulator/instructions/cmp.rs index 3cc7471d9..3dca00938 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/cmp.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/cmp.rs @@ -10,10 +10,8 @@ // CMP-Compare Two Operands // -use crate::arch::emulator::{EmulationError, PlatformEmulator}; use crate::arch::x86::emulator::instructions::*; use crate::arch::x86::regs::*; -use crate::arch::x86::Exception; // CMP affects OF, SF, ZF, AF, PF and CF const FLAGS_MASK: u64 = CF | PF | AF | ZF | SF | OF; diff --git a/hypervisor/src/arch/x86/emulator/instructions/mov.rs b/hypervisor/src/arch/x86/emulator/instructions/mov.rs index 87959eb76..318786fc2 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/mov.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/mov.rs @@ -12,9 +12,7 @@ // Copies the second operand (source operand) to the first operand (destination operand). // -use crate::arch::emulator::{EmulationError, PlatformEmulator}; use crate::arch::x86::emulator::instructions::*; -use crate::arch::x86::Exception; macro_rules! mov_rm_r { ($bound:ty) => { diff --git a/hypervisor/src/arch/x86/emulator/instructions/movs.rs b/hypervisor/src/arch/x86/emulator/instructions/movs.rs index e9acacb0e..f6150b6a5 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/movs.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/movs.rs @@ -10,10 +10,8 @@ // MOVS - Move Data from String to String // -use crate::arch::emulator::{EmulationError, PlatformEmulator}; use crate::arch::x86::emulator::instructions::*; use crate::arch::x86::regs::DF; -use crate::arch::x86::Exception; macro_rules! movs { ($bound:ty) => { diff --git a/hypervisor/src/arch/x86/emulator/instructions/or.rs b/hypervisor/src/arch/x86/emulator/instructions/or.rs index bdabc2ddc..f3af25fd7 100644 --- a/hypervisor/src/arch/x86/emulator/instructions/or.rs +++ b/hypervisor/src/arch/x86/emulator/instructions/or.rs @@ -10,9 +10,7 @@ // OR - Logical inclusive OR // -use crate::arch::emulator::{EmulationError, PlatformEmulator}; use crate::arch::x86::emulator::instructions::*; -use crate::arch::x86::Exception; macro_rules! or_rm_r { ($bound:ty) => { diff --git a/hypervisor/src/arch/x86/emulator/mod.rs b/hypervisor/src/arch/x86/emulator/mod.rs index d1000a484..6ebabcfd0 100644 --- a/hypervisor/src/arch/x86/emulator/mod.rs +++ b/hypervisor/src/arch/x86/emulator/mod.rs @@ -651,10 +651,8 @@ mod mock_vmm { #![allow(unused_mut)] use super::*; - use crate::arch::emulator::{EmulationError, PlatformEmulator}; - use crate::arch::x86::emulator::{Emulator, EmulatorCpuState as CpuState}; + use crate::arch::x86::emulator::EmulatorCpuState as CpuState; use crate::arch::x86::gdt::{gdt_entry, segment_from_gdt}; - use crate::arch::x86::Exception; use std::sync::{Arc, Mutex}; #[derive(Debug, Clone)] diff --git a/net_util/src/mac.rs b/net_util/src/mac.rs index feb3492fb..0ea5786ad 100644 --- a/net_util/src/mac.rs +++ b/net_util/src/mac.rs @@ -7,7 +7,6 @@ use std::fmt; use std::io; -use std::result::Result; use std::str::FromStr; use serde::de::{Deserialize, Deserializer, Error}; diff --git a/pci/src/device.rs b/pci/src/device.rs index 73f1b0821..cec5786c2 100644 --- a/pci/src/device.rs +++ b/pci/src/device.rs @@ -7,7 +7,7 @@ use crate::PciBarConfiguration; use std::any::Any; use std::fmt::{self, Display}; use std::sync::{Arc, Barrier, Mutex}; -use std::{self, io, result}; +use std::{io, result}; use vm_allocator::{AddressAllocator, SystemAllocator}; use vm_device::{BusDevice, Resource}; diff --git a/performance-metrics/src/performance_tests.rs b/performance-metrics/src/performance_tests.rs index 92db54907..ade33f2b9 100644 --- a/performance-metrics/src/performance_tests.rs +++ b/performance-metrics/src/performance_tests.rs @@ -8,7 +8,6 @@ use crate::{mean, PerformanceTestControl}; use std::fs; use std::path::PathBuf; -use std::string::String; use std::thread; use std::time::Duration; use test_infra::Error as InfraError; diff --git a/rate_limiter/src/lib.rs b/rate_limiter/src/lib.rs index c844f9290..793b3f474 100644 --- a/rate_limiter/src/lib.rs +++ b/rate_limiter/src/lib.rs @@ -522,7 +522,6 @@ pub(crate) mod tests { use super::*; use std::fmt; use std::thread; - use std::time::Duration; impl TokenBucket { // Resets the token bucket: budget set to max capacity and last-updated set to now. diff --git a/src/main.rs b/src/main.rs index 8e12a55ca..35384b5e7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -762,7 +762,6 @@ fn start_vmm(cmd_arguments: ArgMatches) -> Result, Error> { fn main() { #[cfg(all(feature = "tdx", feature = "sev_snp"))] compile_error!("Feature 'tdx' and 'sev_snp' are mutually exclusive."); - #[cfg(all(feature = "sev_snp", not(target_arch = "x86_64")))] compile_error!("Feature 'sev_snp' needs target 'x86_64'"); diff --git a/tpm/src/emulator.rs b/tpm/src/emulator.rs index 33d4a4a62..805637221 100644 --- a/tpm/src/emulator.rs +++ b/tpm/src/emulator.rs @@ -9,7 +9,6 @@ use crate::{TPM_CRB_BUFFER_MAX, TPM_SUCCESS}; use anyhow::anyhow; use libc::c_void; use libc::{sockaddr_storage, socklen_t}; -use std::convert::TryInto; use std::os::unix::io::RawFd; use std::path::Path; use std::{mem, ptr}; diff --git a/tpm/src/lib.rs b/tpm/src/lib.rs index 8066dff97..8625aab71 100644 --- a/tpm/src/lib.rs +++ b/tpm/src/lib.rs @@ -10,7 +10,6 @@ pub mod emulator; pub mod socket; use anyhow::anyhow; -use std::convert::TryInto; use thiserror::Error; pub const TPM_CRB_BUFFER_MAX: usize = 3968; // 0x1_000 - 0x80 diff --git a/vhost_user_block/src/lib.rs b/vhost_user_block/src/lib.rs index 2adef9405..e4bedae0c 100644 --- a/vhost_user_block/src/lib.rs +++ b/vhost_user_block/src/lib.rs @@ -29,7 +29,6 @@ use std::result; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, RwLock, RwLockWriteGuard}; use std::time::Instant; -use std::vec::Vec; use std::{convert, error, fmt, io}; use vhost::vhost_user::message::*; use vhost::vhost_user::Listener; diff --git a/vhost_user_net/src/lib.rs b/vhost_user_net/src/lib.rs index cd4188460..b9b9d9c40 100644 --- a/vhost_user_net/src/lib.rs +++ b/vhost_user_net/src/lib.rs @@ -6,7 +6,7 @@ // // SPDX-License-Identifier: (Apache-2.0 AND BSD-3-Clause) -use libc::{self, EFD_NONBLOCK}; +use libc::EFD_NONBLOCK; use log::*; use net_util::{ open_tap, MacAddr, NetCounters, NetQueuePair, OpenTapError, RxVirtio, Tap, TxVirtio, @@ -20,7 +20,6 @@ use std::ops::Deref; use std::os::unix::io::{AsRawFd, RawFd}; use std::process; use std::sync::{Arc, Mutex, RwLock}; -use std::vec::Vec; use vhost::vhost_user::message::*; use vhost::vhost_user::Listener; use vhost_user_backend::{VhostUserBackendMut, VhostUserDaemon, VringRwLock, VringT}; diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index 816e0f294..b7c77e31b 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -26,6 +26,7 @@ use rate_limiter::group::{RateLimiterGroup, RateLimiterGroupHandle}; use rate_limiter::TokenType; use seccompiler::SeccompAction; use std::collections::BTreeMap; +use std::collections::HashMap; use std::collections::VecDeque; use std::io; use std::num::Wrapping; @@ -35,7 +36,6 @@ use std::path::PathBuf; use std::result; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::sync::{Arc, Barrier}; -use std::{collections::HashMap, convert::TryInto}; use thiserror::Error; use versionize::{VersionMap, Versionize, VersionizeResult}; use versionize_derive::Versionize; diff --git a/virtio-devices/src/lib.rs b/virtio-devices/src/lib.rs index 680cbe29c..04d4eb5eb 100644 --- a/virtio-devices/src/lib.rs +++ b/virtio-devices/src/lib.rs @@ -16,7 +16,6 @@ extern crate event_monitor; extern crate log; use serde::{Deserialize, Serialize}; -use std::convert::TryInto; use std::io; use thiserror::Error; diff --git a/virtio-devices/src/net.rs b/virtio-devices/src/net.rs index 6a5de7131..12805bcd1 100644 --- a/virtio-devices/src/net.rs +++ b/virtio-devices/src/net.rs @@ -24,6 +24,7 @@ use net_util::{ NetQueuePair, OpenTapError, RxVirtio, Tap, TapError, TxVirtio, VirtioNetConfig, }; use seccompiler::SeccompAction; +use std::collections::HashMap; use std::net::Ipv4Addr; use std::num::Wrapping; use std::ops::Deref; @@ -32,8 +33,6 @@ use std::result; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Barrier}; use std::thread; -use std::vec::Vec; -use std::{collections::HashMap, convert::TryInto}; use thiserror::Error; use versionize::{VersionMap, Versionize, VersionizeResult}; use versionize_derive::Versionize; diff --git a/virtio-devices/src/seccomp_filters.rs b/virtio-devices/src/seccomp_filters.rs index b9e7e5f17..d535c7dcc 100644 --- a/virtio-devices/src/seccomp_filters.rs +++ b/virtio-devices/src/seccomp_filters.rs @@ -8,7 +8,6 @@ use seccompiler::{ BpfProgram, Error, SeccompAction, SeccompCmpArgLen as ArgLen, SeccompCmpOp::Eq, SeccompCondition as Cond, SeccompFilter, SeccompRule, }; -use std::convert::TryInto; pub enum Thread { VirtioBalloon, diff --git a/virtio-devices/src/transport/pci_common_config.rs b/virtio-devices/src/transport/pci_common_config.rs index f4142e5a4..7c82dda2f 100644 --- a/virtio-devices/src/transport/pci_common_config.rs +++ b/virtio-devices/src/transport/pci_common_config.rs @@ -330,8 +330,6 @@ mod tests { use super::*; use crate::GuestMemoryMmap; use crate::{ActivateResult, VirtioInterrupt}; - use std::sync::Arc; - use virtio_queue::Queue; use vm_memory::GuestMemoryAtomic; use vmm_sys_util::eventfd::EventFd; diff --git a/virtio-devices/src/vhost_user/blk.rs b/virtio-devices/src/vhost_user/blk.rs index 5e3e10f1f..2729fe29f 100644 --- a/virtio-devices/src/vhost_user/blk.rs +++ b/virtio-devices/src/vhost_user/blk.rs @@ -16,7 +16,6 @@ use std::result; use std::sync::atomic::AtomicBool; use std::sync::{Arc, Barrier, Mutex}; use std::thread; -use std::vec::Vec; use versionize::{VersionMap, Versionize, VersionizeResult}; use versionize_derive::Versionize; use vhost::vhost_user::message::{ diff --git a/virtio-devices/src/vhost_user/fs.rs b/virtio-devices/src/vhost_user/fs.rs index 63d79444b..3679b6e58 100644 --- a/virtio-devices/src/vhost_user/fs.rs +++ b/virtio-devices/src/vhost_user/fs.rs @@ -11,7 +11,7 @@ use crate::{ VirtioInterrupt, VirtioSharedMemoryList, VIRTIO_F_IOMMU_PLATFORM, }; use crate::{GuestMemoryMmap, GuestRegionMmap, MmapRegion}; -use libc::{self, c_void, off64_t, pread64, pwrite64}; +use libc::{c_void, off64_t, pread64, pwrite64}; use seccompiler::SeccompAction; use std::io; use std::os::unix::io::AsRawFd; diff --git a/virtio-devices/src/vhost_user/net.rs b/virtio-devices/src/vhost_user/net.rs index 6c413eef6..abe427c06 100644 --- a/virtio-devices/src/vhost_user/net.rs +++ b/virtio-devices/src/vhost_user/net.rs @@ -16,7 +16,6 @@ use std::result; use std::sync::atomic::AtomicBool; use std::sync::{Arc, Barrier, Mutex}; use std::thread; -use std::vec::Vec; use versionize::{VersionMap, Versionize, VersionizeResult}; use versionize_derive::Versionize; use vhost::vhost_user::message::{VhostUserProtocolFeatures, VhostUserVirtioFeatures}; diff --git a/virtio-devices/src/vhost_user/vu_common_ctrl.rs b/virtio-devices/src/vhost_user/vu_common_ctrl.rs index 6f980f23d..9fc6b4d89 100644 --- a/virtio-devices/src/vhost_user/vu_common_ctrl.rs +++ b/virtio-devices/src/vhost_user/vu_common_ctrl.rs @@ -15,7 +15,6 @@ use std::sync::atomic::Ordering; use std::sync::Arc; use std::thread::sleep; use std::time::{Duration, Instant}; -use std::vec::Vec; use vhost::vhost_kern::vhost_binding::{VHOST_F_LOG_ALL, VHOST_VRING_F_LOG}; use vhost::vhost_user::message::{ VhostUserHeaderFlag, VhostUserInflight, VhostUserProtocolFeatures, VhostUserVirtioFeatures, diff --git a/virtio-devices/src/vsock/csm/connection.rs b/virtio-devices/src/vsock/csm/connection.rs index cb5452e67..a5dd6f7c4 100644 --- a/virtio-devices/src/vsock/csm/connection.rs +++ b/virtio-devices/src/vsock/csm/connection.rs @@ -672,18 +672,13 @@ where #[cfg(test)] mod tests { - use libc::EFD_NONBLOCK; - use virtio_queue::QueueOwnedT; - - use std::io::{Error as IoError, ErrorKind, Read, Result as IoResult, Write}; - use std::os::unix::io::RawFd; - use std::time::{Duration, Instant}; - use vmm_sys_util::eventfd::EventFd; - - use super::super::super::defs::uapi; use super::super::super::tests::TestContext; use super::super::defs as csm_defs; use super::*; + use libc::EFD_NONBLOCK; + use std::io::{Error as IoError, Result as IoResult}; + use virtio_queue::QueueOwnedT; + use vmm_sys_util::eventfd::EventFd; const LOCAL_CID: u64 = 2; const PEER_CID: u64 = 3; diff --git a/virtio-devices/src/vsock/csm/txbuf.rs b/virtio-devices/src/vsock/csm/txbuf.rs index 83d4a8203..5f0e7254c 100644 --- a/virtio-devices/src/vsock/csm/txbuf.rs +++ b/virtio-devices/src/vsock/csm/txbuf.rs @@ -146,8 +146,8 @@ impl TxBuf { mod tests { use super::*; use std::io::Error as IoError; + use std::io::ErrorKind; use std::io::Result as IoResult; - use std::io::{ErrorKind, Write}; struct TestSink { data: Vec, diff --git a/virtio-devices/src/vsock/device.rs b/virtio-devices/src/vsock/device.rs index 8411cb71c..35be15582 100644 --- a/virtio-devices/src/vsock/device.rs +++ b/virtio-devices/src/vsock/device.rs @@ -530,7 +530,6 @@ mod tests { use super::super::tests::{NoopVirtioInterrupt, TestContext}; use super::super::*; use super::*; - use crate::vsock::device::{BACKEND_EVENT, EVT_QUEUE_EVENT, RX_QUEUE_EVENT, TX_QUEUE_EVENT}; use crate::ActivateError; use libc::EFD_NONBLOCK; diff --git a/virtio-devices/src/vsock/unix/muxer.rs b/virtio-devices/src/vsock/unix/muxer.rs index 591944fe3..89dd2511e 100644 --- a/virtio-devices/src/vsock/unix/muxer.rs +++ b/virtio-devices/src/vsock/unix/muxer.rs @@ -851,16 +851,12 @@ impl VsockMuxer { #[cfg(test)] mod tests { - use std::io::{Read, Write}; - use std::ops::Drop; - use std::os::unix::net::{UnixListener, UnixStream}; - use std::path::{Path, PathBuf}; - - use virtio_queue::QueueOwnedT; - use super::super::super::csm::defs as csm_defs; use super::super::super::tests::TestContext as VsockTestContext; use super::*; + use std::io::Write; + use std::path::{Path, PathBuf}; + use virtio_queue::QueueOwnedT; const PEER_CID: u32 = 3; const PEER_BUF_ALLOC: u32 = 64 * 1024; diff --git a/vm-device/src/bus.rs b/vm-device/src/bus.rs index c7f415cec..081cf6b8e 100644 --- a/vm-device/src/bus.rs +++ b/vm-device/src/bus.rs @@ -7,7 +7,7 @@ //! Handles routing to devices in an address space. -use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}; +use std::cmp::Ordering; use std::collections::btree_map::BTreeMap; use std::sync::{Arc, Barrier, Mutex, RwLock, Weak}; use std::{convert, error, fmt, io, result}; diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 4b4e618ae..b026b777b 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -10,7 +10,6 @@ use option_parser::{ }; use serde::{Deserialize, Serialize}; use std::collections::{BTreeSet, HashMap}; -use std::convert::From; use std::fmt; use std::path::PathBuf; use std::result; diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index 121f14a52..d163d106a 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -2035,7 +2035,7 @@ mod unit_tests { use crate::config::DebugConsoleConfig; use config::{ ConsoleConfig, ConsoleOutputMode, CpusConfig, HotplugMethod, MemoryConfig, PayloadConfig, - RngConfig, VmConfig, + RngConfig, }; fn create_dummy_vmm() -> Vmm { diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index eb57d3dbe..89ea38d8f 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -28,7 +28,6 @@ use serde::{Deserialize, Serialize}; #[cfg(all(target_arch = "x86_64", feature = "guest_debug"))] use std::collections::BTreeMap; use std::collections::HashMap; -use std::convert::TryInto; use std::fs::{File, OpenOptions}; use std::io::{self}; use std::ops::{BitAnd, Deref, Not, Sub}; diff --git a/vmm/src/pci_segment.rs b/vmm/src/pci_segment.rs index 7736027fb..0b9b7f019 100644 --- a/vmm/src/pci_segment.rs +++ b/vmm/src/pci_segment.rs @@ -10,7 +10,7 @@ // use crate::device_manager::{AddressManager, DeviceManagerError, DeviceManagerResult}; -use acpi_tables::{self, aml, Aml}; +use acpi_tables::{aml, Aml}; use arch::layout; use pci::{DeviceRelocation, PciBdf, PciBus, PciConfigMmio, PciRoot}; #[cfg(target_arch = "x86_64")] diff --git a/vmm/src/seccomp_filters.rs b/vmm/src/seccomp_filters.rs index 99d840dc2..b0c9a6bbd 100644 --- a/vmm/src/seccomp_filters.rs +++ b/vmm/src/seccomp_filters.rs @@ -9,7 +9,6 @@ use seccompiler::{ BackendError, BpfProgram, Error, SeccompAction, SeccompCmpArgLen as ArgLen, SeccompCmpOp::Eq, SeccompCondition as Cond, SeccompFilter, SeccompRule, }; -use std::convert::TryInto; pub enum Thread { HttpApi, diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 30971d63d..53a6721ca 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -73,7 +73,6 @@ use serde::{Deserialize, Serialize}; use std::cmp; use std::collections::BTreeMap; use std::collections::HashMap; -use std::convert::TryInto; use std::fs::{File, OpenOptions}; use std::io::{self, Seek, SeekFrom, Write}; #[cfg(all(target_arch = "x86_64", feature = "guest_debug"))]