mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
cloud-hypervisor: Add devices crate
Based on the Firecracker devices crate from commit 9cdb5b2. It is a trimmed down version compared to the Firecracker one, to remove a bunch of pulled dependencies (logger, metrics, rate limiter, etc...). Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
extern crate kvm_ioctls;
|
||||
|
||||
use kvm_ioctls::*;
|
||||
use std::path::Path;
|
||||
|
||||
pub mod vm;
|
||||
|
||||
use self::vm::{Result, Vm};
|
||||
use self::vm::{Result, Vm, VmConfig};
|
||||
|
||||
struct Vmm {
|
||||
kvm: Kvm,
|
||||
@@ -22,9 +22,9 @@ impl Vmm {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn boot_kernel(kernel: &Path) -> Result<()> {
|
||||
pub fn boot_kernel(config: VmConfig) -> Result<()> {
|
||||
let vmm = Vmm::new()?;
|
||||
let mut vm = Vm::new(&vmm.kvm, kernel)?;
|
||||
let mut vm = Vm::new(&vmm.kvm, config)?;
|
||||
|
||||
let entry = vm.load_kernel()?;
|
||||
vm.start(entry)?;
|
||||
|
||||
Reference in New Issue
Block a user