mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
arch, hypervisor, vmm: KvmHyperVisor -> KvmHypervisor
"Hypervisor" is one word. The "v" shouldn't be capitalised. No functional change. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
b00171e17d
commit
b27439b6ed
@ -121,7 +121,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_setlint() {
|
||||
let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let vm = hv.create_vm().expect("new VM fd creation failed");
|
||||
assert!(hv.check_capability(hypervisor::kvm::Cap::Irqchip));
|
||||
|
@ -365,7 +365,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_setup_fpu() {
|
||||
let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let vm = hv.create_vm().expect("new VM fd creation failed");
|
||||
let vcpu = vm.create_vcpu(0).unwrap();
|
||||
@ -391,7 +391,7 @@ mod tests {
|
||||
use hypervisor::arch::x86::msr_index;
|
||||
use hypervisor::x86_64::{MsrEntries, MsrEntry};
|
||||
|
||||
let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let vm = hv.create_vm().expect("new VM fd creation failed");
|
||||
let vcpu = vm.create_vcpu(0).unwrap();
|
||||
@ -418,7 +418,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_setup_regs() {
|
||||
let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let vm = hv.create_vm().expect("new VM fd creation failed");
|
||||
let vcpu = vm.create_vcpu(0).unwrap();
|
||||
@ -447,7 +447,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_setup_sregs() {
|
||||
let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let vm = hv.create_vm().expect("new VM fd creation failed");
|
||||
let vcpu = vm.create_vcpu(0).unwrap();
|
||||
|
@ -73,7 +73,7 @@ pub struct KvmVm {
|
||||
/// Example:
|
||||
/// #[cfg(feature = "kvm")]
|
||||
/// extern crate hypervisor
|
||||
/// let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
/// let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
/// let hypervisor: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
/// let vm = hypervisor.create_vm().expect("new VM fd creation failed");
|
||||
/// vm.set/get().unwrap()
|
||||
@ -227,7 +227,7 @@ impl vm::Vm for KvmVm {
|
||||
}
|
||||
}
|
||||
/// Wrapper over KVM system ioctls.
|
||||
pub struct KvmHyperVisor {
|
||||
pub struct KvmHypervisor {
|
||||
kvm: Kvm,
|
||||
}
|
||||
/// Enum for KVM related error
|
||||
@ -236,28 +236,28 @@ pub enum KvmError {
|
||||
CapabilityMissing(Cap),
|
||||
}
|
||||
pub type KvmResult<T> = result::Result<T, KvmError>;
|
||||
impl KvmHyperVisor {
|
||||
impl KvmHypervisor {
|
||||
/// Create a hypervisor based on Kvm
|
||||
pub fn new() -> hypervisor::Result<KvmHyperVisor> {
|
||||
pub fn new() -> hypervisor::Result<KvmHypervisor> {
|
||||
let kvm_obj = Kvm::new().map_err(|e| hypervisor::HypervisorError::VmCreate(e.into()))?;
|
||||
Ok(KvmHyperVisor { kvm: kvm_obj })
|
||||
Ok(KvmHypervisor { kvm: kvm_obj })
|
||||
}
|
||||
}
|
||||
/// Implementation of Hypervisor trait for KVM
|
||||
/// Example:
|
||||
/// #[cfg(feature = "kvm")]
|
||||
/// extern crate hypervisor
|
||||
/// let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
/// let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
/// let hypervisor: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
/// let vm = hypervisor.create_vm().expect("new VM fd creation failed");
|
||||
///
|
||||
impl hypervisor::Hypervisor for KvmHyperVisor {
|
||||
impl hypervisor::Hypervisor for KvmHypervisor {
|
||||
/// Create a KVM vm object and return the object as Vm trait object
|
||||
/// Example
|
||||
/// # extern crate hypervisor;
|
||||
/// # use hypervisor::KvmHyperVisor;
|
||||
/// # use hypervisor::KvmHypervisor;
|
||||
/// use hypervisor::KvmVm;
|
||||
/// let hypervisor = KvmHyperVisor::new().unwrap();
|
||||
/// let hypervisor = KvmHypervisor::new().unwrap();
|
||||
/// let vm = hypervisor.create_vm().unwrap()
|
||||
///
|
||||
fn create_vm(&self) -> hypervisor::Result<Arc<dyn vm::Vm>> {
|
||||
@ -341,7 +341,7 @@ pub struct KvmVcpu {
|
||||
/// Example:
|
||||
/// #[cfg(feature = "kvm")]
|
||||
/// extern crate hypervisor
|
||||
/// let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
/// let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
/// let hypervisor: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
/// let vm = hypervisor.create_vm().expect("new VM fd creation failed");
|
||||
/// let vcpu = vm.create_vcpu(0).unwrap();
|
||||
@ -567,9 +567,9 @@ impl cpu::Vcpu for KvmVcpu {
|
||||
///
|
||||
/// ```rust
|
||||
/// # extern crate hypervisor;
|
||||
/// # use hypervisor::KvmHyperVisor;
|
||||
/// # use hypervisor::KvmHypervisor;
|
||||
/// # use std::sync::Arc;
|
||||
/// let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
/// let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
/// let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
/// let vm = hv.create_vm().expect("new VM fd creation failed");
|
||||
/// vm.enable_split_irq().unwrap();
|
||||
@ -613,9 +613,9 @@ impl cpu::Vcpu for KvmVcpu {
|
||||
///
|
||||
/// ```rust
|
||||
/// # extern crate hypervisor;
|
||||
/// # use hypervisor::KvmHyperVisor;
|
||||
/// # use hypervisor::KvmHypervisor;
|
||||
/// # use std::sync::Arc;
|
||||
/// let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
/// let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
/// let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
/// let vm = hv.create_vm().expect("new VM fd creation failed");
|
||||
/// vm.enable_split_irq().unwrap();
|
||||
|
@ -10,7 +10,7 @@ extern crate vmm_sys_util;
|
||||
extern crate clap;
|
||||
|
||||
use clap::{App, Arg, ArgGroup, ArgMatches};
|
||||
use hypervisor::kvm::KvmHyperVisor as Hypervisor;
|
||||
use hypervisor::kvm::KvmHypervisor as Hypervisor;
|
||||
use libc::EFD_NONBLOCK;
|
||||
use log::LevelFilter;
|
||||
use seccomp::SeccompLevel;
|
||||
|
@ -1446,7 +1446,7 @@ pub fn test_vm() {
|
||||
let load_addr = GuestAddress(0x1000);
|
||||
let mem = GuestMemoryMmap::from_ranges(&[(load_addr, mem_size)]).unwrap();
|
||||
|
||||
let kvm = hypervisor::kvm::KvmHyperVisor::new().unwrap();
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let vm_fd = hv.create_vm().expect("new VM fd creation failed");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user