diff --git a/block/src/vhdx_sync.rs b/block/src/vhdx_sync.rs index 48d25714e..867997825 100644 --- a/block/src/vhdx_sync.rs +++ b/block/src/vhdx_sync.rs @@ -82,6 +82,18 @@ impl disk_file::Resizable for VhdxDiskSync { impl disk_file::DiskFile for VhdxDiskSync {} +impl disk_file::AsyncDiskFile for VhdxDiskSync { + fn try_clone(&self) -> BlockResult> { + Ok(Box::new(VhdxDiskSync { + vhdx_file: Arc::clone(&self.vhdx_file), + })) + } + + fn new_async_io(&self, _ring_depth: u32) -> BlockResult> { + Ok(Box::new(VhdxSync::new(Arc::clone(&self.vhdx_file)))) + } +} + impl DiskFile for VhdxDiskSync { fn logical_size(&mut self) -> DiskFileResult { Ok(self.vhdx_file.lock().unwrap().virtual_disk_size())