mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: vhdx: impl DiskFd for VhdxDiskSync
Returns the raw fd from the inner Vhdx via mutex lock. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
@@ -60,6 +60,12 @@ impl disk_file::PhysicalSize for VhdxDiskSync {
|
||||
}
|
||||
}
|
||||
|
||||
impl disk_file::DiskFd for VhdxDiskSync {
|
||||
fn fd(&self) -> BorrowedDiskFd<'_> {
|
||||
BorrowedDiskFd::new(self.vhdx_file.lock().unwrap().as_raw_fd())
|
||||
}
|
||||
}
|
||||
|
||||
impl DiskFile for VhdxDiskSync {
|
||||
fn logical_size(&mut self) -> DiskFileResult<u64> {
|
||||
Ok(self.vhdx_file.lock().unwrap().virtual_disk_size())
|
||||
|
||||
Reference in New Issue
Block a user