mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: merge qcow, vhdx and block_util into block crate
This commit merges crates `qcow`, `vhdx` and `block_util` into the crate `block`, which can allow `qcow` to use functions from `block_util` without introducing a circular crate dependency. This commit is based on crosvm implementation: https://chromium.googlesource.com/crosvm/crosvm/+/f2eecc4152eca8d395566cffa2c102ec090a152d Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
This commit is contained in:
@@ -19,7 +19,7 @@ use crate::thread_helper::spawn_virtio_thread;
|
||||
use crate::GuestMemoryMmap;
|
||||
use crate::VirtioInterrupt;
|
||||
use anyhow::anyhow;
|
||||
use block_util::{
|
||||
use block::{
|
||||
async_io::AsyncIo, async_io::AsyncIoError, async_io::DiskFile, build_disk_image_id, Request,
|
||||
RequestType, VirtioBlockConfig,
|
||||
};
|
||||
@@ -63,11 +63,11 @@ const LATENCY_SCALE: u64 = 10000;
|
||||
#[derive(Error, Debug)]
|
||||
pub enum Error {
|
||||
#[error("Failed to parse the request: {0}")]
|
||||
RequestParsing(block_util::Error),
|
||||
RequestParsing(block::Error),
|
||||
#[error("Failed to execute the request: {0}")]
|
||||
RequestExecuting(block_util::ExecuteError),
|
||||
RequestExecuting(block::ExecuteError),
|
||||
#[error("Failed to complete the request: {0}")]
|
||||
RequestCompleting(block_util::Error),
|
||||
RequestCompleting(block::Error),
|
||||
#[error("Missing the expected entry in the list of requests")]
|
||||
MissingEntryRequestList,
|
||||
#[error("The asynchronous request returned with failure")]
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::thread_helper::spawn_virtio_thread;
|
||||
use crate::vhost_user::VhostUserCommon;
|
||||
use crate::{GuestMemoryMmap, GuestRegionMmap};
|
||||
use crate::{VirtioInterrupt, VIRTIO_F_IOMMU_PLATFORM};
|
||||
use block_util::VirtioBlockConfig;
|
||||
use block::VirtioBlockConfig;
|
||||
use seccompiler::SeccompAction;
|
||||
use std::mem;
|
||||
use std::result;
|
||||
|
||||
Reference in New Issue
Block a user