mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: disk_file: Add PhysicalSize trait
Host allocation size for file-backed disk images. Reports actual bytes occupied on the host filesystem. Not every format supports this, e.g. network or memory backed disks. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
85e4e5027c
commit
2df731b8d3
@@ -42,3 +42,9 @@ pub trait DiskSize: Send + Debug {
|
||||
/// Virtual size of the disk image in bytes (reported capacity).
|
||||
fn logical_size(&self) -> BlockResult<u64>;
|
||||
}
|
||||
|
||||
/// Host allocation size of a file-backed disk image.
|
||||
pub trait PhysicalSize: Send + Debug {
|
||||
/// Actual bytes occupied on the host filesystem.
|
||||
fn physical_size(&self) -> BlockResult<u64>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user