fn run_microvm(
        api_event_fd: EventFd,
        from_api: Receiver<ApiRequest>,
        to_api: Sender<ApiResponse>,
        vm_resources: VmResources,
        vmm: Arc<Mutex<Vmm>>,
        event_manager: &mut EventManager,
    ) -> ExitCode {
        let api_adapter = Arc::new(Mutex::new(Self {
            api_event_fd,
            from_api,
            to_api,
            controller: RuntimeApiController::new(vm_resources, vmm.clone()),
        }));
        event_manager.add_subscriber(api_adapter);
        loop {
            event_manager
                .run()
                .expect("EventManager events driver fatal error");
            if let Some(exit_code) = vmm.lock().unwrap().shutdown_exit_code() {
                return exit_code;
            }
        }
    }
/// Runs the vmm to completion, while any arising control events are deferred
/// to a `RuntimeApiController`.
Runs the vmm to completion, while any arising control events are deferred
to a `RuntimeApiController`.
Runs the vmm to completion while any arising control events are deferred to a ` RuntimeApiController ` .
fn run_microvm(
        api_event_fd: EventFd,
        from_api: Receiver<ApiRequest>,
        to_api: Sender<ApiResponse>,
        vm_resources: VmResources,
        vmm: Arc<Mutex<Vmm>>,
        event_manager: &mut EventManager,
    ) -> ExitCode {
        let api_adapter = Arc::new(Mutex::new(Self {
            api_event_fd,
            from_api,
            to_api,
            controller: RuntimeApiController::new(vm_resources, vmm.clone()),
        }));
        event_manager.add_subscriber(api_adapter);
        loop {
            event_manager
                .run()
                .expect("EventManager events driver fatal error");
            if let Some(exit_code) = vmm.lock().unwrap().shutdown_exit_code() {
                return exit_code;
            }
        }
    }
fn run_microvm ( api_event_fd : EventFd , from_api : Receiver < ApiRequest > , to_api : Sender < ApiResponse > , vm_resources : VmResources , vmm : Arc < Mutex < Vmm > > , event_manager : & mut EventManager , ) -> ExitCode { let api_adapter = Arc :: new ( Mutex :: new ( Self { api_event_fd , from_api , to_api , controller : RuntimeApiController :: new ( vm_resources , vmm . clone ( ) ) , } ) ) ; event_manager . add_subscriber ( api_adapter ) ; loop { event_manager . run ( ) . expect ( " " ) ; if let Some ( exit_code ) = vmm . lock ( ) . unwrap ( ) . shutdown_exit_code ( ) { return exit_code ; } } }
Runs the vmm to completion, while any arising control events are deferred
to a `RuntimeApiController`.
Runs the vmm to completion while any arising control events are deferred to a ` RuntimeApiController ` .
api_event_fd
EventFd
from_api
Receiver<ApiRequest>
to_api
Sender<ApiResponse>
vm_resources
VmResources
vmm
Arc<Mutex<Vmm>>
event_manager
&mut EventManager
api_event_fd
EventFd
from_api
Receiver<ApiRequest>
to_api
Sender<ApiResponse>
vm_resources
VmResources
vmm
Arc<Mutex<Vmm>>
event_manager
&mut EventManager