fn build_microvm_from_json(
    seccomp_filters: &BpfThreadMap,
    event_manager: &mut EventManager,
    config_json: String,
    instance_info: InstanceInfo,
    boot_timer_enabled: bool,
) -> std::result::Result<(VmResources, Arc<Mutex<vmm::Vmm>>), ExitCode> {
    let mut vm_resources = VmResources::from_json(&config_json, &instance_info).map_err(|err| {
        error!(
            "Configuration for VMM from one single json failed: {:?}",
            err
        );
        vmm::FC_EXIT_CODE_BAD_CONFIGURATION
    })?;
    vm_resources.boot_timer = boot_timer_enabled;
    let vmm = vmm::builder::build_microvm_for_boot(
        &instance_info,
        &vm_resources,
        event_manager,
        seccomp_filters,
    )
    .map_err(|err| {
        error!(
            "Building VMM configured from cmdline json failed: {:?}",
            err
        );
        vmm::FC_EXIT_CODE_BAD_CONFIGURATION
    })?;
    info!("Successfully started microvm that was configured from one single json");

    Ok((vm_resources, vmm))
}
// Configure and start a microVM as described by the command-line JSON.
Configure and start a microVM as described by the command-line JSON.
Configure and start a microVM as described by the command - line JSON .
fn build_microvm_from_json(
    seccomp_filters: &BpfThreadMap,
    event_manager: &mut EventManager,
    config_json: String,
    instance_info: InstanceInfo,
    boot_timer_enabled: bool,
) -> std::result::Result<(VmResources, Arc<Mutex<vmm::Vmm>>), ExitCode> {
    let mut vm_resources = VmResources::from_json(&config_json, &instance_info).map_err(|err| {
        error!(
            "Configuration for VMM from one single json failed: {:?}",
            err
        );
        vmm::FC_EXIT_CODE_BAD_CONFIGURATION
    })?;
    vm_resources.boot_timer = boot_timer_enabled;
    let vmm = vmm::builder::build_microvm_for_boot(
        &instance_info,
        &vm_resources,
        event_manager,
        seccomp_filters,
    )
    .map_err(|err| {
        error!(
            "Building VMM configured from cmdline json failed: {:?}",
            err
        );
        vmm::FC_EXIT_CODE_BAD_CONFIGURATION
    })?;
    info!("Successfully started microvm that was configured from one single json");
    Ok((vm_resources, vmm))
}
fn build_microvm_from_json ( seccomp_filters : & BpfThreadMap , event_manager : & mut EventManager , config_json : String , instance_info : InstanceInfo , boot_timer_enabled : bool , ) -> std :: result :: Result < ( VmResources , Arc < Mutex < vmm :: Vmm > > ) , ExitCode > { let mut vm_resources = VmResources :: from_json ( & config_json , & instance_info ) . map_err ( | err | { error ! ( " " err ) ; vmm :: FC_EXIT_CODE_BAD_CONFIGURATION } ) ? ; vm_resources . boot_timer = boot_timer_enabled ; let vmm = vmm :: builder :: build_microvm_for_boot ( & instance_info , & vm_resources , event_manager , seccomp_filters , ) . map_err ( | err | { error ! ( " " err ) ; vmm :: FC_EXIT_CODE_BAD_CONFIGURATION } ) ? ; info ! ( " " ) ; Ok ( ( vm_resources , vmm ) ) }
Configure and start a microVM as described by the command-line JSON.
Configure and start a microVM as described by the command - line JSON .
seccomp_filters
&BpfThreadMap
event_manager
&mut EventManager
config_json
String
instance_info
InstanceInfo
boot_timer_enabled
bool
seccomp_filters
&BpfThreadMap
event_manager
&mut EventManager
config_json
String
instance_info
InstanceInfo
boot_timer_enabled
bool