mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: vhd: impl DiskSize for FixedVhdDiskSync
Delegate to FixedVhd::logical_size() which returns the guest visible capacity parsed from the VHD footer at construction. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
@@ -7,14 +7,15 @@ use std::os::unix::io::{AsRawFd, RawFd};
|
||||
|
||||
use vmm_sys_util::eventfd::EventFd;
|
||||
|
||||
use crate::BlockBackend;
|
||||
use crate::async_io::{
|
||||
AsyncIo, AsyncIoError, AsyncIoResult, BorrowedDiskFd, DiskFile, DiskFileError, DiskFileResult,
|
||||
};
|
||||
use crate::error::{BlockError, BlockResult, ErrorOp};
|
||||
use crate::fixed_vhd::FixedVhd;
|
||||
use crate::raw_sync::RawFileSync;
|
||||
use crate::{BlockBackend, disk_file};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FixedVhdDiskSync(FixedVhd);
|
||||
|
||||
impl FixedVhdDiskSync {
|
||||
@@ -52,6 +53,12 @@ impl DiskFile for FixedVhdDiskSync {
|
||||
}
|
||||
}
|
||||
|
||||
impl disk_file::DiskSize for FixedVhdDiskSync {
|
||||
fn logical_size(&self) -> BlockResult<u64> {
|
||||
Ok(self.0.logical_size().unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct FixedVhdSync {
|
||||
raw_file_sync: RawFileSync,
|
||||
size: u64,
|
||||
|
||||
Reference in New Issue
Block a user