Skip to main content

Hypervisor

Trait Hypervisor 

Source
pub trait Hypervisor: 'static {
    type ProtoPartition<'a>: ProtoPartition<Partition = Self::Partition>;
    type Partition;
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn platform_info(&self) -> PlatformInfo;
    fn new_partition<'a>(
        &'a mut self,
        config: ProtoPartitionConfig<'a>,
    ) -> Result<Self::ProtoPartition<'a>, Self::Error>;

    // Provided method
    fn recognizes_nested_virt(&self) -> bool { ... }
}
Expand description

A hypervisor backend capable of creating partitions.

§Recognized features

The recognizes_* methods report whether the backend acts on an optional partition request rather than silently ignoring it: it either honors the request or fails partition creation with a specific error. They let the code assembling a ProtoPartitionConfig reject a request up front when the backend has no concept of it, instead of the request being quietly dropped. Recognition is not a promise that the request succeeds — the backend may still reject it in combination with another feature, or fail later during partition creation. Each method defaults to false, so a new optional feature is unrecognized everywhere until a backend overrides its method.

Required Associated Types§

Source

type ProtoPartition<'a>: ProtoPartition<Partition = Self::Partition>

The prototype partition type.

Source

type Partition

The partition type.

Source

type Error: Error + Send + Sync + 'static

The error type when creating the partition.

Required Methods§

Source

fn platform_info(&self) -> PlatformInfo

Returns platform capabilities detected from the hypervisor.

This is called before partition creation to query platform-specific information needed for topology construction and firmware table generation.

Source

fn new_partition<'a>( &'a mut self, config: ProtoPartitionConfig<'a>, ) -> Result<Self::ProtoPartition<'a>, Self::Error>

Returns a new prototype partition from the given configuration.

Provided Methods§

Source

fn recognizes_nested_virt(&self) -> bool

Whether the backend recognizes a request to expose hardware virtualization (VMX/SVM) to the guest so it can run its own hypervisor. See the Hypervisor trait docs on recognized features.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§