qcow, virtio-devices: Break cyclic dependency

Move the definition of RawFile from virtio-devices crate into qcow
crate. All the code that consumes RawFile also already depends on the
qcow crate for image file type detection so this change breaks the
need for the qcow crate to depend on the very large virtio-devices
crate.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-07-10 15:43:12 +01:00
committed by Sebastien Boeuf
parent 6161d3bef8
commit 4963e37dc8
8 changed files with 341 additions and 330 deletions

View File

@@ -207,7 +207,7 @@ impl VhostUserBlkBackend {
options.custom_flags(libc::O_DIRECT);
}
let image: File = options.open(&image_path).unwrap();
let mut raw_img: virtio_devices::RawFile = virtio_devices::RawFile::new(image, direct);
let mut raw_img: qcow::RawFile = qcow::RawFile::new(image, direct);
let image_id = build_disk_image_id(&PathBuf::from(&image_path));
let image_type = qcow::detect_image_type(&mut raw_img).unwrap();