mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 15:31:15 +00:00
vmm: Move to the latest linux-loader
Commit 2adddce2 reorganized the crate for a cleaner multi architecture (x86_64 and aarch64) support. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
785812d976
commit
8fc7bf2953
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -468,7 +468,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-loader"
|
name = "linux-loader"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/rust-vmm/linux-loader#bf2e6ea1500e1f92c4d7721b234824a2db8e9a40"
|
source = "git+https://github.com/rust-vmm/linux-loader#2adddce25b37f68c99ae8e7db1cb7f5853626fdd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"vm-memory 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"vm-memory 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
@ -16,7 +16,7 @@ pub mod regs;
|
|||||||
use crate::InitramfsConfig;
|
use crate::InitramfsConfig;
|
||||||
use crate::RegionType;
|
use crate::RegionType;
|
||||||
use linux_loader::loader::bootparam::{boot_params, setup_header};
|
use linux_loader::loader::bootparam::{boot_params, setup_header};
|
||||||
use linux_loader::loader::start_info::{hvm_memmap_table_entry, hvm_start_info};
|
use linux_loader::loader::elf::start_info::{hvm_memmap_table_entry, hvm_start_info};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use vm_memory::{
|
use vm_memory::{
|
||||||
Address, ByteValued, Bytes, GuestAddress, GuestMemory, GuestMemoryMmap, GuestMemoryRegion,
|
Address, ByteValued, Bytes, GuestAddress, GuestMemory, GuestMemoryMmap, GuestMemoryRegion,
|
||||||
|
@ -36,6 +36,7 @@ use devices::{ioapic, HotPlugNotificationFlags};
|
|||||||
use kvm_bindings::{kvm_enable_cap, kvm_userspace_memory_region, KVM_CAP_SPLIT_IRQCHIP};
|
use kvm_bindings::{kvm_enable_cap, kvm_userspace_memory_region, KVM_CAP_SPLIT_IRQCHIP};
|
||||||
use kvm_ioctls::*;
|
use kvm_ioctls::*;
|
||||||
use linux_loader::cmdline::Cmdline;
|
use linux_loader::cmdline::Cmdline;
|
||||||
|
use linux_loader::loader::elf::Error::InvalidElfMagicNumber;
|
||||||
use linux_loader::loader::KernelLoader;
|
use linux_loader::loader::KernelLoader;
|
||||||
use signal_hook::{iterator::Signals, SIGINT, SIGTERM, SIGWINCH};
|
use signal_hook::{iterator::Signals, SIGINT, SIGTERM, SIGWINCH};
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
@ -436,15 +437,15 @@ impl Vm {
|
|||||||
let cmdline_cstring = CString::new(cmdline).map_err(Error::CmdLineCString)?;
|
let cmdline_cstring = CString::new(cmdline).map_err(Error::CmdLineCString)?;
|
||||||
let guest_memory = self.memory_manager.lock().as_ref().unwrap().guest_memory();
|
let guest_memory = self.memory_manager.lock().as_ref().unwrap().guest_memory();
|
||||||
let mem = guest_memory.memory();
|
let mem = guest_memory.memory();
|
||||||
let entry_addr = match linux_loader::loader::Elf::load(
|
let entry_addr = match linux_loader::loader::elf::Elf::load(
|
||||||
mem.deref(),
|
mem.deref(),
|
||||||
None,
|
None,
|
||||||
&mut self.kernel,
|
&mut self.kernel,
|
||||||
Some(arch::layout::HIGH_RAM_START),
|
Some(arch::layout::HIGH_RAM_START),
|
||||||
) {
|
) {
|
||||||
Ok(entry_addr) => entry_addr,
|
Ok(entry_addr) => entry_addr,
|
||||||
Err(linux_loader::loader::Error::InvalidElfMagicNumber) => {
|
Err(linux_loader::loader::Error::Elf(InvalidElfMagicNumber)) => {
|
||||||
linux_loader::loader::BzImage::load(
|
linux_loader::loader::bzimage::BzImage::load(
|
||||||
mem.deref(),
|
mem.deref(),
|
||||||
None,
|
None,
|
||||||
&mut self.kernel,
|
&mut self.kernel,
|
||||||
|
Loading…
Reference in New Issue
Block a user