Skip to main content

krun_start_enter

Function krun_start_enter 

Source
pub unsafe extern "C" fn krun_start_enter(ctx_id: u32) -> i32
Expand description

Starts and enters the microVM with the configured parameters. The VMM will attempt to take over stdin/stdout to manage them on behalf of the process running inside the isolated environment, simulating that the latter has direct control of the terminal.

This function consumes the configuration pointed by the context ID.

Arguments: “ctx_id” - the configuration context ID.

Notes: This function only returns if an error happens before starting the microVM. Otherwise, the VMM assumes it has full control of the process, and will call to exit() with the workload’s exit code once the microVM shuts down. If an error occurred before running the workload the process will exit() with an error exit code.

Error exit codes: 125 - “init” cannot set up the environment inside the microVM. 126 - “init” can find the executable to be run inside the microVM but cannot execute it. 127 - “init” cannot find the executable to be run inside the microVM.

Returns: -EINVAL - The VMM has detected an error in the microVM configuration.