pub struct VmConfigBuilder { /* private fields */ }Implementations§
Source§impl VmConfigBuilder
impl VmConfigBuilder
Sourcepub fn sync_disk(self, enabled: bool) -> Self
pub fn sync_disk(self, enabled: bool) -> Self
When false, the disk image is attached with no host durability (SynchronizationMode::None). Only for throwaway disks that are discarded when the VM stops — never for disks read back afterwards (checkpoints).
Sourcepub fn console(self, enabled: bool) -> Self
pub fn console(self, enabled: bool) -> Self
When false, serial console stdin is disconnected and stdout goes to stderr. This prevents the serial console from consuming host stdin in exec/shell mode.
Sourcepub fn verbose(self, enabled: bool) -> Self
pub fn verbose(self, enabled: bool) -> Self
When true, serial console output (kernel dmesg, initramfs) is shown even in non-console mode. Default is false (quiet).
pub fn kernel(self, path: impl Into<String>) -> Self
pub fn rootfs(self, path: impl Into<String>) -> Self
pub fn initrd(self, path: impl Into<String>) -> Self
pub fn cpus(self, n: usize) -> Self
pub fn memory_mb(self, mb: u64) -> Self
Sourcepub fn network_fd(self, fd: i32) -> Self
pub fn network_fd(self, fd: i32) -> Self
Attach a network device via a socketpair fd for proxy-based networking.
Sourcepub fn nbd_uri(self, uri: impl Into<String>) -> Self
pub fn nbd_uri(self, uri: impl Into<String>) -> Self
Use an NBD server for the root disk instead of a direct disk image.
Sourcepub fn mount(self, config: MountConfig) -> Self
pub fn mount(self, config: MountConfig) -> Self
Add a host directory mount (virtio-fs).
pub fn build(self) -> Result<Sandbox>
Auto Trait Implementations§
impl Freeze for VmConfigBuilder
impl RefUnwindSafe for VmConfigBuilder
impl Send for VmConfigBuilder
impl Sync for VmConfigBuilder
impl Unpin for VmConfigBuilder
impl UnsafeUnpin for VmConfigBuilder
impl UnwindSafe for VmConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more