mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 03:12:27 +00:00
block_util: Use vmm_sys_util::tempfile::Tempfile
This removes the requirement for an extra crate. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
0497a7c311
commit
cf7a05ecb5
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -164,7 +164,6 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"tempfile",
|
||||
"thiserror",
|
||||
"virtio-bindings",
|
||||
"vm-memory",
|
||||
|
@ -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"
|
||||
|
@ -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<u8> {
|
||||
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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user