mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: Implement DiskFd trait for RawFileDisk
Add disk_file::DiskFd trait implementation for RawFileDisk. Delegates to file.as_raw_fd() via BorrowedDiskFd, taking &self instead of &mut self. Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
@@ -90,6 +90,12 @@ impl disk_file::PhysicalSize for RawFileDisk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl disk_file::DiskFd for RawFileDisk {
|
||||||
|
fn fd(&self) -> BorrowedDiskFd<'_> {
|
||||||
|
BorrowedDiskFd::new(self.file.as_raw_fd())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct RawFileAsync {
|
pub struct RawFileAsync {
|
||||||
fd: RawFd,
|
fd: RawFd,
|
||||||
io_uring: IoUring,
|
io_uring: IoUring,
|
||||||
|
|||||||
Reference in New Issue
Block a user