From a335cbb8d569d427b0c17e8c3441b8c945a50bed Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 19 May 2021 13:12:54 +0000 Subject: [PATCH] hypervisor: Unconditional build Hypervisor::create_vm_with_type() Mark it as unreachable for now in the default implementation as this is currently only used on tdx code path which is KVM only. Signed-off-by: Rob Bradford --- hypervisor/src/hypervisor.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hypervisor/src/hypervisor.rs b/hypervisor/src/hypervisor.rs index aea750e48..48ea62348 100644 --- a/hypervisor/src/hypervisor.rs +++ b/hypervisor/src/hypervisor.rs @@ -72,12 +72,13 @@ pub trait Hypervisor: Send + Sync { /// Return a hypervisor-agnostic Vm trait object /// fn create_vm(&self) -> Result>; - #[cfg(feature = "kvm")] /// /// Create a Vm of a specific type using the underlying hypervisor /// Return a hypervisor-agnostic Vm trait object /// - fn create_vm_with_type(&self, vm_type: u64) -> Result>; + fn create_vm_with_type(&self, _vm_type: u64) -> Result> { + unreachable!() + } #[cfg(target_arch = "x86_64")] /// /// Get the supported CpuID