pub struct VmManifestBuilder { /* private fields */ }
Expand description
Builder for a VM manifest.
Implementations§
Source§impl VmManifestBuilder
impl VmManifestBuilder
Sourcepub fn new(ty: BaseChipsetType, arch: MachineArch) -> Self
pub fn new(ty: BaseChipsetType, arch: MachineArch) -> Self
Create a new VM manifest builder for the given chipset type and architecture.
Sourcepub fn with_serial(
self,
serial: [Option<Resource<SerialBackendHandle>>; 4],
) -> Self
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.
Sourcepub fn with_serial_wait_for_rts(self) -> Self
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.
Sourcepub fn with_debugcon(
self,
serial: Resource<SerialBackendHandle>,
port: u16,
) -> Self
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
Sourcepub fn with_proxy_vga(self) -> Self
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.
Sourcepub fn with_battery(
self,
battery_status_recv: Receiver<HostBatteryUpdate>,
) -> Self
pub fn with_battery( self, battery_status_recv: Receiver<HostBatteryUpdate>, ) -> Self
Enable the battery device.
Sourcepub fn with_stub_floppy(self) -> Self
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.
Sourcepub fn with_framebuffer(self) -> Self
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.
Sourcepub fn with_guest_watchdog(self) -> Self
pub fn with_guest_watchdog(self) -> Self
Enable the guest watchdog device.
Sourcepub fn build(self) -> Result<VmChipsetResult, Error>
pub fn build(self) -> Result<VmChipsetResult, Error>
Build the VM manifest.