diff --git a/block/src/vhdx_sync.rs b/block/src/vhdx_sync.rs index 867997825..0405554c1 100644 --- a/block/src/vhdx_sync.rs +++ b/block/src/vhdx_sync.rs @@ -9,9 +9,7 @@ use std::sync::{Arc, Mutex}; use vmm_sys_util::eventfd::EventFd; -use crate::async_io::{ - AsyncIo, AsyncIoError, AsyncIoResult, BorrowedDiskFd, DiskFile, DiskFileError, DiskFileResult, -}; +use crate::async_io::{AsyncIo, AsyncIoError, AsyncIoResult, BorrowedDiskFd, DiskFileError}; use crate::error::{BlockError, BlockErrorKind, BlockResult, ErrorOp}; use crate::vhdx::Vhdx; use crate::{AsyncAdaptor, BlockBackend, Error, disk_file}; @@ -94,30 +92,6 @@ impl disk_file::AsyncDiskFile for VhdxDiskSync { } } -impl DiskFile for VhdxDiskSync { - fn logical_size(&mut self) -> DiskFileResult { - Ok(self.vhdx_file.lock().unwrap().virtual_disk_size()) - } - - fn physical_size(&mut self) -> DiskFileResult { - self.vhdx_file.lock().unwrap().physical_size().map_err(|e| { - let io_inner = match e { - Error::GetFileMetadata(e) => e, - _ => unreachable!(), - }; - DiskFileError::Size(io_inner) - }) - } - - fn new_async_io(&self, _ring_depth: u32) -> DiskFileResult> { - Ok(Box::new(VhdxSync::new(Arc::clone(&self.vhdx_file))) as Box) - } - - fn fd(&mut self) -> BorrowedDiskFd<'_> { - BorrowedDiskFd::new(self.vhdx_file.lock().unwrap().as_raw_fd()) - } -} - pub struct VhdxSync { vhdx_file: Arc>, eventfd: EventFd,