diff --git a/Cargo.lock b/Cargo.lock index fa8a59723..a5e47e3cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -164,7 +164,6 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "tempfile", "thiserror", "virtio-bindings", "vm-memory", diff --git a/block_util/Cargo.toml b/block_util/Cargo.toml index 55eaf88af..e99abcb8b 100644 --- a/block_util/Cargo.toml +++ b/block_util/Cargo.toml @@ -22,5 +22,3 @@ vm-memory = { version = "0.5.0", features = ["backend-mmap", "backend-atomic"] } vm-virtio = { path = "../vm-virtio" } vmm-sys-util = ">=0.3.1" -[dev-dependencies] -tempfile = "3.2.0" diff --git a/block_util/src/vhd.rs b/block_util/src/vhd.rs index 257aba984..1d0cc98e9 100644 --- a/block_util/src/vhd.rs +++ b/block_util/src/vhd.rs @@ -124,7 +124,7 @@ mod tests { use super::{is_fixed_vhd, VhdFooter}; use std::fs::File; use std::io::{Seek, SeekFrom, Write}; - use tempfile::tempfile; + use vmm_sys_util::tempfile::TempFile; fn valid_fixed_vhd_footer() -> Vec { vec![ @@ -172,7 +172,7 @@ mod tests { where F: FnMut(File), { - let mut disk_file: File = tempfile().unwrap(); + let mut disk_file: File = TempFile::new().unwrap().into_file(); disk_file.set_len(0x1000_0200).unwrap(); disk_file.seek(SeekFrom::Start(0x1000_0000)).unwrap(); disk_file.write_all(&footer).unwrap();