Skip to main content

MachineBuilder

Struct MachineBuilder 

Source
pub struct MachineBuilder<T, S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<T, S: State> MachineBuilder<T, S>

Source

pub fn build(self) -> Machine<T>
where S: IsComplete,

Finish building and return the requested object

Source

pub fn machine_type(self, value: T) -> MachineBuilder<T, SetMachineType<S>>
where S::MachineType: IsUnset,

Required.

The QEMU machine type name.

Source

pub fn accel(self, value: Vec<AccelType>) -> MachineBuilder<T, SetAccel<S>>
where S::Accel: IsUnset,

Optional (Some / Option setters). This is used to enable an accelerator. Depending on the target architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available. By default, tcg is used. If there is more than one accelerator specified, the next one is used if the previous one fails to initialize.

Source

pub fn maybe_accel( self, value: Option<Vec<AccelType>>, ) -> MachineBuilder<T, SetAccel<S>>
where S::Accel: IsUnset,

Optional (Some / Option setters). This is used to enable an accelerator. Depending on the target architecture, kvm, xen, hvf, nvmm, whpx or tcg can be available. By default, tcg is used. If there is more than one accelerator specified, the next one is used if the previous one fails to initialize.

Source

pub fn vmport(self, value: OnOffAuto) -> MachineBuilder<T, SetVmport<S>>
where S::Vmport: IsUnset,

Optional (Some / Option setters). Enables emulation of VMWare IO port, for vmmouse etc. auto says

Source

pub fn maybe_vmport( self, value: Option<OnOffAuto>, ) -> MachineBuilder<T, SetVmport<S>>
where S::Vmport: IsUnset,

Optional (Some / Option setters). Enables emulation of VMWare IO port, for vmmouse etc. auto says

Source

pub fn dump_guest_core( self, value: OnOffDefaultOn, ) -> MachineBuilder<T, SetDumpGuestCore<S>>
where S::DumpGuestCore: IsUnset,

Optional (Some / Option setters). Include guest memory in a core dump. The default is on.

Source

pub fn maybe_dump_guest_core( self, value: Option<OnOffDefaultOn>, ) -> MachineBuilder<T, SetDumpGuestCore<S>>
where S::DumpGuestCore: IsUnset,

Optional (Some / Option setters). Include guest memory in a core dump. The default is on.

Source

pub fn mem_merge( self, value: OnOffDefaultOn, ) -> MachineBuilder<T, SetMemMerge<S>>
where S::MemMerge: IsUnset,

Optional (Some / Option setters). Enables or disables memory merge support. This feature, when

Source

pub fn maybe_mem_merge( self, value: Option<OnOffDefaultOn>, ) -> MachineBuilder<T, SetMemMerge<S>>
where S::MemMerge: IsUnset,

Optional (Some / Option setters). Enables or disables memory merge support. This feature, when

Source

pub fn aes_key_wrap( self, value: OnOffDefaultOn, ) -> MachineBuilder<T, SetAesKeyWrap<S>>
where S::AesKeyWrap: IsUnset,

Optional (Some / Option setters). Enables or disables AES key wrapping support on s390-ccw hosts. This feature controls whether AES wrapping keys will be created to allow execution of AES cryptographic functions. The default is on.

Source

pub fn maybe_aes_key_wrap( self, value: Option<OnOffDefaultOn>, ) -> MachineBuilder<T, SetAesKeyWrap<S>>
where S::AesKeyWrap: IsUnset,

Optional (Some / Option setters). Enables or disables AES key wrapping support on s390-ccw hosts. This feature controls whether AES wrapping keys will be created to allow execution of AES cryptographic functions. The default is on.

Source

pub fn dea_key_wrap( self, value: OnOffDefaultOn, ) -> MachineBuilder<T, SetDeaKeyWrap<S>>
where S::DeaKeyWrap: IsUnset,

Optional (Some / Option setters). Enables or disables DEA key wrapping support on s390-ccw hosts. This feature controls whether DEA wrapping keys will be created to allow execution of DEA cryptographic functions. The default is on.

Source

pub fn maybe_dea_key_wrap( self, value: Option<OnOffDefaultOn>, ) -> MachineBuilder<T, SetDeaKeyWrap<S>>
where S::DeaKeyWrap: IsUnset,

Optional (Some / Option setters). Enables or disables DEA key wrapping support on s390-ccw hosts. This feature controls whether DEA wrapping keys will be created to allow execution of DEA cryptographic functions. The default is on.

Source

pub fn nvdimm(self, value: OnOffDefaultOff) -> MachineBuilder<T, SetNvdimm<S>>
where S::Nvdimm: IsUnset,

Optional (Some / Option setters). Enables or disables NVDIMM support. The default is off.

Source

pub fn maybe_nvdimm( self, value: Option<OnOffDefaultOff>, ) -> MachineBuilder<T, SetNvdimm<S>>
where S::Nvdimm: IsUnset,

Optional (Some / Option setters). Enables or disables NVDIMM support. The default is off.

Source

pub fn memory_encryption( self, value: ShellString, ) -> MachineBuilder<T, SetMemoryEncryption<S>>
where S::MemoryEncryption: IsUnset,

Optional (Some / Option setters). Memory encryption object to use. The default is none.

Source

pub fn maybe_memory_encryption( self, value: Option<ShellString>, ) -> MachineBuilder<T, SetMemoryEncryption<S>>
where S::MemoryEncryption: IsUnset,

Optional (Some / Option setters). Memory encryption object to use. The default is none.

Source

pub fn confidential_guest_support( self, value: ShellString, ) -> MachineBuilder<T, SetConfidentialGuestSupport<S>>
where S::ConfidentialGuestSupport: IsUnset,

Optional (Some / Option setters). Confidential guest support object to use. The default is none.

Source

pub fn maybe_confidential_guest_support( self, value: Option<ShellString>, ) -> MachineBuilder<T, SetConfidentialGuestSupport<S>>
where S::ConfidentialGuestSupport: IsUnset,

Optional (Some / Option setters). Confidential guest support object to use. The default is none.

Source

pub fn hmat(self, value: OnOffDefaultOff) -> MachineBuilder<T, SetHmat<S>>
where S::Hmat: IsUnset,

Optional (Some / Option setters). Enables or disables ACPI Heterogeneous Memory Attribute Table (HMAT) support. The default is off.

Source

pub fn maybe_hmat( self, value: Option<OnOffDefaultOff>, ) -> MachineBuilder<T, SetHmat<S>>
where S::Hmat: IsUnset,

Optional (Some / Option setters). Enables or disables ACPI Heterogeneous Memory Attribute Table (HMAT) support. The default is off.

Source

pub fn spcr(self, value: OnOffDefaultOn) -> MachineBuilder<T, SetSpcr<S>>
where S::Spcr: IsUnset,

Optional (Some / Option setters). Enables or disables ACPI Serial Port Console Redirection Table (SPCR) support. The default is on.

Source

pub fn maybe_spcr( self, value: Option<OnOffDefaultOn>, ) -> MachineBuilder<T, SetSpcr<S>>
where S::Spcr: IsUnset,

Optional (Some / Option setters). Enables or disables ACPI Serial Port Console Redirection Table (SPCR) support. The default is on.

Source

pub fn aux_ram_share( self, value: OnOffDefaultOff, ) -> MachineBuilder<T, SetAuxRamShare<S>>
where S::AuxRamShare: IsUnset,

Optional (Some / Option setters). Allocate auxiliary guest RAM as an anonymous file that is shareable with an external process. This option applies to memory allocated as a side effect of creating various devices. It does not apply to memory-backend-objects, whether explicitly specified on the command line, or implicitly created by the -m command line option. The default is off.

Source

pub fn maybe_aux_ram_share( self, value: Option<OnOffDefaultOff>, ) -> MachineBuilder<T, SetAuxRamShare<S>>
where S::AuxRamShare: IsUnset,

Optional (Some / Option setters). Allocate auxiliary guest RAM as an anonymous file that is shareable with an external process. This option applies to memory allocated as a side effect of creating various devices. It does not apply to memory-backend-objects, whether explicitly specified on the command line, or implicitly created by the -m command line option. The default is off.

Source

pub fn memory_backend( self, value: ShellString, ) -> MachineBuilder<T, SetMemoryBackend<S>>
where S::MemoryBackend: IsUnset,

Optional (Some / Option setters). An alternative to legacy -mem-path and mem-prealloc options. Allows to use a memory backend as main RAM.

Source

pub fn maybe_memory_backend( self, value: Option<ShellString>, ) -> MachineBuilder<T, SetMemoryBackend<S>>
where S::MemoryBackend: IsUnset,

Optional (Some / Option setters). An alternative to legacy -mem-path and mem-prealloc options. Allows to use a memory backend as main RAM.

Source

pub fn cxl_fmw(self, value: Vec<CxlFmw>) -> MachineBuilder<T, SetCxlFmw<S>>
where S::CxlFmw: IsUnset,

Optional (Some / Option setters). CXL fixed memory windows.

Source

pub fn maybe_cxl_fmw( self, value: Option<Vec<CxlFmw>>, ) -> MachineBuilder<T, SetCxlFmw<S>>
where S::CxlFmw: IsUnset,

Optional (Some / Option setters). CXL fixed memory windows.

Source

pub fn igvm_cfg(self, value: ShellString) -> MachineBuilder<T, SetIgvmCfg<S>>
where S::IgvmCfg: IsUnset,

Optional (Some / Option setters). IGVM configuration object to use for initial guest state.

Source

pub fn maybe_igvm_cfg( self, value: Option<ShellString>, ) -> MachineBuilder<T, SetIgvmCfg<S>>
where S::IgvmCfg: IsUnset,

Optional (Some / Option setters). IGVM configuration object to use for initial guest state.

Source

pub fn sgx_epc(self, value: Vec<SgxEpc>) -> MachineBuilder<T, SetSgxEpc<S>>
where S::SgxEpc: IsUnset,

Optional (Some / Option setters). SGX EPC sections.

Source

pub fn maybe_sgx_epc( self, value: Option<Vec<SgxEpc>>, ) -> MachineBuilder<T, SetSgxEpc<S>>
where S::SgxEpc: IsUnset,

Optional (Some / Option setters). SGX EPC sections.

Auto Trait Implementations§

§

impl<T, S> Freeze for MachineBuilder<T, S>
where T: Freeze,

§

impl<T, S> RefUnwindSafe for MachineBuilder<T, S>
where T: RefUnwindSafe,

§

impl<T, S> Send for MachineBuilder<T, S>
where T: Send,

§

impl<T, S> Sync for MachineBuilder<T, S>
where T: Sync,

§

impl<T, S> Unpin for MachineBuilder<T, S>
where T: Unpin,

§

impl<T, S> UnsafeUnpin for MachineBuilder<T, S>
where T: UnsafeUnpin,

§

impl<T, S> UnwindSafe for MachineBuilder<T, S>
where T: UnwindSafe,

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.

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V