1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! msb_krun - Native Rust API for libkrun microVMs.
//!
//! This crate provides a builder-pattern API for creating and entering microVMs
//! using libkrun's VMM infrastructure.
//!
//! # Lifecycle
//!
//! [`Vm::enter()`] never returns on success. When the guest shuts down, the
//! VMM calls `_exit()`, killing the entire process. `enter()` only returns
//! `Err` if something fails before the VMM takes over.
//!
//! # Example
//!
//! ```rust,no_run
//! use msb_krun::{VmBuilder, Result};
//!
//! fn main() -> Result<()> {
//! VmBuilder::new()
//! .machine(|m| m.vcpus(4).memory_mib(2048))
//! .fs(|fs| fs.root("/path/to/rootfs"))
//! .exec(|e| e.path("/bin/myapp").args(["--flag"]).env("HOME", "/root"))
//! .build()?
//! .enter()?;
//!
//! unreachable!()
//! }
//! ```
//--------------------------------------------------------------------------------------------------
// Modules
//--------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------
// Re-Exports
//--------------------------------------------------------------------------------------------------
pub use VmBuilder;
pub use DiskBuilder;
pub use DiskImageFormat;
pub use NetBuilder;
pub use ;
pub use ;
pub use ExitHandle;
pub use Vm;
pub use ConsolePortBackend;
pub use DynFileSystem;
pub use NetBackend;