mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: qcow_async: impl DiskSize for QcowDiskAsync
Delegates to QcowMetadata::virtual_size, identical to the sync backend. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
3422a8b258
commit
f777113818
@@ -10,6 +10,7 @@ use std::fmt;
|
||||
use std::fs::File;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::disk_file;
|
||||
use crate::error::{BlockErrorKind, BlockResult, ErrorOp};
|
||||
use crate::qcow::backing::shared_backing_from;
|
||||
use crate::qcow::metadata::{BackingRead, QcowMetadata};
|
||||
@@ -68,3 +69,9 @@ impl Drop for QcowDiskAsync {
|
||||
self.metadata.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
impl disk_file::DiskSize for QcowDiskAsync {
|
||||
fn logical_size(&self) -> BlockResult<u64> {
|
||||
Ok(self.metadata.virtual_size())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user