From 6e36932e90735c4cf1fc38cb314ce50e9d22f517 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 25 Mar 2026 16:46:46 +0100 Subject: [PATCH] block: vhdx: Remove legacy async_io::DiskFile impl from VhdxDiskSync All functionality now provided by composable disk_file traits. Signed-off-by: Anatol Belski --- block/src/vhdx_sync.rs | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) 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,