mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: Implement DiskFd trait for RawFileDiskSync
Add disk_file::DiskFd trait implementation for RawFileDiskSync. 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:
@@ -81,6 +81,12 @@ impl disk_file::PhysicalSize for RawFileDiskSync {
|
||||
}
|
||||
}
|
||||
|
||||
impl disk_file::DiskFd for RawFileDiskSync {
|
||||
fn fd(&self) -> BorrowedDiskFd<'_> {
|
||||
BorrowedDiskFd::new(self.file.as_raw_fd())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct RawFileSync {
|
||||
fd: RawFd,
|
||||
eventfd: EventFd,
|
||||
|
||||
Reference in New Issue
Block a user