pub fn save_state(&mut self) -> std::result::Result<MicrovmState, MicrovmStateError> {
        use self::MicrovmStateError::SaveVmState;
        let vcpu_states = self.save_vcpu_states()?;
        let vm_state = {
            #[cfg(target_arch = "x86_64")]
            {
                self.vm.save_state().map_err(SaveVmState)?
            }
            #[cfg(target_arch = "aarch64")]
            {
                let mpidrs = construct_kvm_mpidrs(&vcpu_states);

                self.vm.save_state(&mpidrs).map_err(SaveVmState)?
            }
        };
        let device_states = self.mmio_device_manager.save();

        let mem_size_mib = mem_size_mib(self.guest_memory());
        let memory_state = self.guest_memory().describe();

        Ok(MicrovmState {
            vm_info: VmInfo { mem_size_mib },
            memory_state,
            vm_state,
            vcpu_states,
            device_states,
        })
    }
/// Saves the state of a paused Microvm.
Saves the state of a paused Microvm.
Saves the state of a paused Microvm .
pub fn save_state(&mut self) -> std::result::Result<MicrovmState, MicrovmStateError> {
        use self::MicrovmStateError::SaveVmState;
        let vcpu_states = self.save_vcpu_states()?;
        let vm_state = {
            #[cfg(target_arch = "x86_64")]
            {
                self.vm.save_state().map_err(SaveVmState)?
            }
            #[cfg(target_arch = "aarch64")]
            {
                let mpidrs = construct_kvm_mpidrs(&vcpu_states);
                self.vm.save_state(&mpidrs).map_err(SaveVmState)?
            }
        };
        let device_states = self.mmio_device_manager.save();
        let mem_size_mib = mem_size_mib(self.guest_memory());
        let memory_state = self.guest_memory().describe();
        Ok(MicrovmState {
            vm_info: VmInfo { mem_size_mib },
            memory_state,
            vm_state,
            vcpu_states,
            device_states,
        })
    }
pub fn save_state ( & mut self ) -> std :: result :: Result < MicrovmState , MicrovmStateError > { use self :: MicrovmStateError :: SaveVmState ; let vcpu_states = self . save_vcpu_states ( ) ? ; let vm_state = { # [ cfg ( target_arch " " ) ] { self . vm . save_state ( ) . map_err ( SaveVmState ) ? } # [ cfg ( target_arch " " ) ] { let mpidrs = construct_kvm_mpidrs ( & vcpu_states ) ; self . vm . save_state ( & mpidrs ) . map_err ( SaveVmState ) ? } } ; let device_states = self . mmio_device_manager . save ( ) ; let mem_size_mib = mem_size_mib ( self . guest_memory ( ) ) ; let memory_state = self . guest_memory ( ) . describe ( ) ; Ok ( MicrovmState { vm_info : VmInfo { mem_size_mib } , memory_state , vm_state , vcpu_states , device_states , } ) }
Saves the state of a paused Microvm.
Saves the state of a paused Microvm .
&mut self
&mut self