From 713674454966eae112f28b943387514da750dfae Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 23 Mar 2026 23:54:02 +0100 Subject: [PATCH] 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 --- block/src/fixed_vhd_sync.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/block/src/fixed_vhd_sync.rs b/block/src/fixed_vhd_sync.rs index bf6c431fe..9ea036b90 100644 --- a/block/src/fixed_vhd_sync.rs +++ b/block/src/fixed_vhd_sync.rs @@ -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 { + Ok(self.0.logical_size().unwrap()) + } +} + pub struct FixedVhdSync { raw_file_sync: RawFileSync, size: u64,