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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-05-19 13:12:54 +00:00 committed by Sebastien Boeuf
parent 0cf9218d3f
commit a335cbb8d5

View File

@ -72,12 +72,13 @@ pub trait Hypervisor: Send + Sync {
/// Return a hypervisor-agnostic Vm trait object
///
fn create_vm(&self) -> Result<Arc<dyn Vm>>;
#[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<Arc<dyn Vm>>;
fn create_vm_with_type(&self, _vm_type: u64) -> Result<Arc<dyn Vm>> {
unreachable!()
}
#[cfg(target_arch = "x86_64")]
///
/// Get the supported CpuID