pub fn init(&self, vm_fd: &VmFd) -> Result<()> {
        let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default();

        // This reads back the kernel's preferred target type.
        vm_fd
            .get_preferred_target(&mut kvi)
            .map_err(Error::GetPreferredTarget)?;
        // We already checked that the capability is supported.
        kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_PSCI_0_2;
        // Non-boot cpus are powered off initially.
        if self.index > 0 {
            kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_POWER_OFF;
        }
        self.fd.vcpu_init(&kvi).map_err(Error::Init)
    }
/// Initializes an aarch64 specific vcpu for booting Linux.
///
/// # Arguments
///
/// * `vm_fd` - The kvm `VmFd` for this microvm.
Initializes an aarch64 specific vcpu for booting Linux.
Initializes an aarch64 specific vcpu for booting Linux .
pub fn init(&self, vm_fd: &VmFd) -> Result<()> {
        let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default();
        // This reads back the kernel's preferred target type.
        vm_fd
            .get_preferred_target(&mut kvi)
            .map_err(Error::GetPreferredTarget)?;
        // We already checked that the capability is supported.
        kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_PSCI_0_2;
        // Non-boot cpus are powered off initially.
        if self.index > 0 {
            kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_POWER_OFF;
        }
        self.fd.vcpu_init(&kvi).map_err(Error::Init)
    }
pub fn init ( & self , vm_fd : & VmFd ) -> Result < ( ) > { let mut kvi : kvm_bindings :: kvm_vcpu_init = kvm_bindings :: kvm_vcpu_init :: default ( ) ; // This reads back the kernel's preferred target type. vm_fd . get_preferred_target ( & mut kvi ) . map_err ( Error :: GetPreferredTarget ) ? ; // We already checked that the capability is supported. kvi . features [ 0 ] |= 1 << kvm_bindings :: KVM_ARM_VCPU_PSCI_0_2 ; // Non-boot cpus are powered off initially. if self . index > 0 { kvi . features [ 0 ] |= 1 << kvm_bindings :: KVM_ARM_VCPU_POWER_OFF ; } self . fd . vcpu_init ( & kvi ) . map_err ( Error :: Init ) }
Initializes an aarch64 specific vcpu for booting Linux.
Initializes an aarch64 specific vcpu for booting Linux .
&self
vm_fd
&VmFd
&self
vm_fd
&VmFd