Trait virt::Partition

source ·
pub trait Partition:
    'static
    + Hv1
    + Inspect
    + Send
    + Sync {
    // Required methods
    fn supports_reset(
        &self,
    ) -> Option<&dyn ResetPartition<Error = <Self as Hv1>::Error>>;
    fn request_msi(&self, vtl: Vtl, request: MsiRequest);
    fn caps(&self) -> &PartitionCapabilities;
    fn request_yield(&self, vp_index: VpIndex);

    // Provided methods
    fn supports_initial_accept_pages(
        &self,
    ) -> Option<&dyn AcceptInitialPages<Error = <Self as Hv1>::Error>> { ... }
    fn supports_vtl_scrub(
        &self,
    ) -> Option<&dyn ScrubVtl<Error = <Self as Hv1>::Error>> { ... }
    fn doorbell_registration(
        self: &Arc<Self>,
        minimum_vtl: Vtl,
    ) -> Option<Arc<dyn DoorbellRegistration>> { ... }
    fn msi_interrupt_target(
        self: &Arc<Self>,
        vtl: Vtl,
    ) -> Option<Arc<dyn MsiInterruptTarget>> { ... }
}
Expand description

Methods for manipulating a VM partition.

Required Methods§

source

fn supports_reset( &self, ) -> Option<&dyn ResetPartition<Error = <Self as Hv1>::Error>>

Returns a trait object to reset the partition, if supported.

source

fn request_msi(&self, vtl: Vtl, request: MsiRequest)

Requests an MSI for the specified VTL.

On x86, the MSI format is the architectural APIC format.

On ARM64, the MSI format is currently not defined, since we only support Hyper-V-style VMs (which use synthetic MSIs via VPCI). In the future, we may want to support either or both SPI- and ITS+LPI-based MSIs.

source

fn caps(&self) -> &PartitionCapabilities

Get the partition capabilities for this partition.

source

fn request_yield(&self, vp_index: VpIndex)

Forces the run_vp call to yield to the scheduler (i.e. return Poll::Pending).

Provided Methods§

source

fn supports_initial_accept_pages( &self, ) -> Option<&dyn AcceptInitialPages<Error = <Self as Hv1>::Error>>

Returns a trait object to accept pages on behalf of the guest during the initial start import flow.

source

fn supports_vtl_scrub( &self, ) -> Option<&dyn ScrubVtl<Error = <Self as Hv1>::Error>>

Returns a trait object to reset VTL state, if supported.

source

fn doorbell_registration( self: &Arc<Self>, minimum_vtl: Vtl, ) -> Option<Arc<dyn DoorbellRegistration>>

Returns an interface for registering MMIO doorbells for this partition.

Not all partitions support this.

source

fn msi_interrupt_target( self: &Arc<Self>, vtl: Vtl, ) -> Option<Arc<dyn MsiInterruptTarget>>

Returns an MSI interrupt target for this partition, which can be used to create MSI interrupts.

Not all partitions support this.

Object Safety§

This trait is not object safe.

Implementors§