hypervisor: allow downcasting to hypervisor VM types

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-07-20 12:52:06 +00:00
committed by Liu Wei
parent f84ddedb1a
commit b5270e0b45
3 changed files with 12 additions and 1 deletions

View File

@@ -837,6 +837,10 @@ impl vm::Vm for KvmVm {
)
.map_err(vm::HypervisorVmError::InitMemRegionTdx)
}
/// Downcast to the underlying KvmVm type
fn as_any(&self) -> &dyn Any {
self
}
}
#[cfg(feature = "tdx")]