Skip to main content

run

Function run 

Source
pub fn run(
    snap_path: String,
    ram_size: Option<String>,
    kernel_mode: bool,
    persist_path: Option<PathBuf>,
    qmp_socket: Option<PathBuf>,
    network_mode: String,
    backend_type: String,
    no_graphics: bool,
    vnc: bool,
) -> Result<()>
Expand description

Boots a virtual machine from a Hexz snapshot with optional persistence.

Architectural intent: Mounts the snapshot via FUSE, configures an overlay for writable state, and then launches QEMU with appropriate parameters (RAM, KVM, networking, QMP) so the guest can run directly from the snapshot image.

Constraints: Requires qemu-system-x86_64 and FUSE support on the host. When persist_path is omitted, an ephemeral overlay is used and discarded on exit; callers must supply persist_path if they want changes to survive reboots.

Side effects: Creates temporary directories and overlay files, spawns a FUSE mount thread and a QEMU process, manipulates networking, and may leave resources behind if the process is terminated abruptly.