vm_manifest_builder

Struct VmManifestBuilder

Source
pub struct VmManifestBuilder { /* private fields */ }
Expand description

Builder for a VM manifest.

Implementations§

Source§

impl VmManifestBuilder

Source

pub fn new(ty: BaseChipsetType, arch: MachineArch) -> Self

Create a new VM manifest builder for the given chipset type and architecture.

Source

pub fn with_serial( self, serial: [Option<Resource<SerialBackendHandle>>; 4], ) -> Self

Enable serial ports (of a type determined by the chipset type), backed by the given serial backends.

For Hyper-V generation 1 VMs, serial ports are always present but are disconnected unless this method is called. For other VMs, this method must be called to add serial ports.

For ARM64 VMs, only two serial ports are supported.

Source

pub fn with_serial_wait_for_rts(self) -> Self

Enable wait-for-RTS mode for serial ports.

This ensures that the VMM will not push data into the serial port’s FIFO until the guest has raised the RTS line.

Source

pub fn with_debugcon( self, serial: Resource<SerialBackendHandle>, port: u16, ) -> Self

Enable the debugcon output-only serial device at the specified port, backed by the given serial backend.

Only supported on x86

Source

pub fn with_proxy_vga(self) -> Self

Enable the proxy VGA device.

This is used for Underhill VMs that are emulating Hyper-V generation 1 VMs.

Source

pub fn with_battery( self, battery_status_recv: Receiver<HostBatteryUpdate>, ) -> Self

Enable the battery device.

Source

pub fn with_stub_floppy(self) -> Self

Enable the stub floppy device instead of the full floppy device implementation.

This is used to support the saved states for VMs that used the stub floppy device.

This is only supported for Hyper-V generation 1 VMs. Panics otherwise.

Source

pub fn with_framebuffer(self) -> Self

Enable the framebuffer device.

This is implicit for Hyper-V generation 1 VMs.

This method will be removed once all devices depending on the framebuffer are managed through this builder type.

Source

pub fn with_guest_watchdog(self) -> Self

Enable the guest watchdog device.

Source

pub fn with_psp(self) -> Self

Enable the AMD64 PSP device.

Source

pub fn build(self) -> Result<VmChipsetResult, Error>

Build the VM manifest.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more