fn create_vcpu(
        &self,
        id: u8,
        vmmops: Option<Arc<Box<dyn VmmOps>>>,
    ) -> vm::Result<Arc<dyn cpu::Vcpu>> {
        let vcpu_fd = self
            .fd
            .create_vcpu(id)
            .map_err(|e| vm::HypervisorVmError::CreateVcpu(e.into()))?;
        let vcpu = MshvVcpu {
            fd: vcpu_fd,
            vp_index: id,
            cpuid: CpuId::new(1),
            msrs: self.msrs.clone(),
            ioeventfds: self.ioeventfds.clone(),
            gsi_routes: self.gsi_routes.clone(),
            hv_state: self.hv_state.clone(),
            vmmops,
        };
        Ok(Arc::new(vcpu))
    }
///
/// Creates a VcpuFd object from a vcpu RawFd.
///
Creates a VcpuFd object from a vcpu RawFd.
Creates a VcpuFd object from a vcpu RawFd .
fn create_vcpu(
        &self,
        id: u8,
        vmmops: Option<Arc<Box<dyn VmmOps>>>,
    ) -> vm::Result<Arc<dyn cpu::Vcpu>> {
        let vcpu_fd = self
            .fd
            .create_vcpu(id)
            .map_err(|e| vm::HypervisorVmError::CreateVcpu(e.into()))?;
        let vcpu = MshvVcpu {
            fd: vcpu_fd,
            vp_index: id,
            cpuid: CpuId::new(1),
            msrs: self.msrs.clone(),
            ioeventfds: self.ioeventfds.clone(),
            gsi_routes: self.gsi_routes.clone(),
            hv_state: self.hv_state.clone(),
            vmmops,
        };
        Ok(Arc::new(vcpu))
    }
fn create_vcpu ( & self , id : u8 , vmmops : Option < Arc < Box < dyn VmmOps > > > , ) -> vm :: Result < Arc < dyn cpu :: Vcpu > > { let vcpu_fd = self . fd . create_vcpu ( id ) . map_err ( | e | vm :: HypervisorVmError :: CreateVcpu ( e . into ( ) ) ) ? ; let vcpu = MshvVcpu { fd : vcpu_fd , vp_index : id , cpuid : CpuId :: new ( 1 ) , msrs : self . msrs . clone ( ) , ioeventfds : self . ioeventfds . clone ( ) , gsi_routes : self . gsi_routes . clone ( ) , hv_state : self . hv_state . clone ( ) , vmmops , } ; Ok ( Arc :: new ( vcpu ) ) }
Creates a VcpuFd object from a vcpu RawFd.
Creates a VcpuFd object from a vcpu RawFd .
&self
id
u8
vmmops
Option<Arc<Box<dyn VmmOps>>>
&self
id
u8
vmmops
Option<Arc<Box<dyn VmmOps>>>