pub fn configure_system(&self, vcpus: &[Vcpu], initrd: &Option<InitrdConfig>) -> Result<()> {
        #[cfg(target_arch = "x86_64")]
        arch::x86_64::configure_system(
            &self.guest_memory,
            &self.arch_memory_info,
            vm_memory::GuestAddress(arch::x86_64::layout::CMDLINE_START),
            self.kernel_cmdline.len() + 1,
            initrd,
            vcpus.len() as u8,
        )
        .map_err(Error::ConfigureSystem)?;

        #[cfg(all(target_arch = "aarch64", target_os = "linux"))]
        {
            let vcpu_mpidr = vcpus.iter().map(|cpu| cpu.get_mpidr()).collect();
            arch::aarch64::configure_system(
                &self.guest_memory,
                &self.arch_memory_info,
                &self
                    .kernel_cmdline
                    .as_cstring()
                    .map_err(Error::LoadCommandline)?,
                vcpu_mpidr,
                self.mmio_device_manager.get_device_info(),
                self.vm.get_irqchip(),
                initrd,
            )
            .map_err(Error::ConfigureSystem)?;
        }

        #[cfg(all(target_arch = "aarch64", target_os = "macos"))]
        {
            let vcpu_mpidr = vcpus.iter().map(|cpu| cpu.get_mpidr()).collect();
            arch::aarch64::configure_system(
                &self.guest_memory,
                &self.arch_memory_info,
                &self
                    .kernel_cmdline
                    .as_cstring()
                    .map_err(Error::LoadCommandline)?,
                vcpu_mpidr,
                self.mmio_device_manager.get_device_info(),
                self.vm.get_irqchip(),
                initrd,
            )
            .map_err(Error::ConfigureSystem)?;
        }
        Ok(())
    }
/// Configures the system for boot.
Configures the system for boot.
Configures the system for boot .
pub fn configure_system(&self, vcpus: &[Vcpu], initrd: &Option<InitrdConfig>) -> Result<()> {
        #[cfg(target_arch = "x86_64")]
        arch::x86_64::configure_system(
            &self.guest_memory,
            &self.arch_memory_info,
            vm_memory::GuestAddress(arch::x86_64::layout::CMDLINE_START),
            self.kernel_cmdline.len() + 1,
            initrd,
            vcpus.len() as u8,
        )
        .map_err(Error::ConfigureSystem)?;
        #[cfg(all(target_arch = "aarch64", target_os = "linux"))]
        {
            let vcpu_mpidr = vcpus.iter().map(|cpu| cpu.get_mpidr()).collect();
            arch::aarch64::configure_system(
                &self.guest_memory,
                &self.arch_memory_info,
                &self
                    .kernel_cmdline
                    .as_cstring()
                    .map_err(Error::LoadCommandline)?,
                vcpu_mpidr,
                self.mmio_device_manager.get_device_info(),
                self.vm.get_irqchip(),
                initrd,
            )
            .map_err(Error::ConfigureSystem)?;
        }
        #[cfg(all(target_arch = "aarch64", target_os = "macos"))]
        {
            let vcpu_mpidr = vcpus.iter().map(|cpu| cpu.get_mpidr()).collect();
            arch::aarch64::configure_system(
                &self.guest_memory,
                &self.arch_memory_info,
                &self
                    .kernel_cmdline
                    .as_cstring()
                    .map_err(Error::LoadCommandline)?,
                vcpu_mpidr,
                self.mmio_device_manager.get_device_info(),
                self.vm.get_irqchip(),
                initrd,
            )
            .map_err(Error::ConfigureSystem)?;
        }
        Ok(())
    }
pub fn configure_system ( & self , vcpus : & [ Vcpu ] , initrd : & Option < InitrdConfig > ) -> Result < ( ) > { # [ cfg ( target_arch " " ) ] arch :: x86_64 :: configure_system ( & self . guest_memory , & self . arch_memory_info , vm_memory :: GuestAddress ( arch :: x86_64 :: layout :: CMDLINE_START ) , self . kernel_cmdline . len ( ) + 1 , initrd , vcpus . len ( ) as u8 , ) . map_err ( Error :: ConfigureSystem ) ? ; # [ cfg ( all ( target_arch " " target_os " " ) ) ] { let vcpu_mpidr = vcpus . iter ( ) . map ( | cpu | cpu . get_mpidr ( ) ) . collect ( ) ; arch :: aarch64 :: configure_system ( & self . guest_memory , & self . arch_memory_info , & self . kernel_cmdline . as_cstring ( ) . map_err ( Error :: LoadCommandline ) ? , vcpu_mpidr , self . mmio_device_manager . get_device_info ( ) , self . vm . get_irqchip ( ) , initrd , ) . map_err ( Error :: ConfigureSystem ) ? ; } # [ cfg ( all ( target_arch " " target_os " " ) ) ] { let vcpu_mpidr = vcpus . iter ( ) . map ( | cpu | cpu . get_mpidr ( ) ) . collect ( ) ; arch :: aarch64 :: configure_system ( & self . guest_memory , & self . arch_memory_info , & self . kernel_cmdline . as_cstring ( ) . map_err ( Error :: LoadCommandline ) ? , vcpu_mpidr , self . mmio_device_manager . get_device_info ( ) , self . vm . get_irqchip ( ) , initrd , ) . map_err ( Error :: ConfigureSystem ) ? ; } Ok ( ( ) ) }
Configures the system for boot.
Configures the system for boot .
&self
vcpus
&[Vcpu]
initrd
&Option<InitrdConfig>