diff --git a/block/src/disk_file.rs b/block/src/disk_file.rs index 1dbaf1945..31c5ee085 100644 --- a/block/src/disk_file.rs +++ b/block/src/disk_file.rs @@ -36,6 +36,7 @@ use std::fmt::Debug; use crate::BlockResult; +use crate::async_io::BorrowedDiskFd; /// Reported capacity of a disk image. pub trait DiskSize: Send + Debug { @@ -48,3 +49,9 @@ pub trait PhysicalSize: Send + Debug { /// Actual bytes occupied on the host filesystem. fn physical_size(&self) -> BlockResult; } + +/// Backing file descriptor access for disk images backed by a file. +pub trait DiskFd: Send + Debug { + /// Borrows the underlying file descriptor. + fn fd(&self) -> BorrowedDiskFd<'_>; +}