From b27439b6ed2fecb8c3790b96d74ae4f906080b39 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 24 Jun 2020 12:06:29 +0000 Subject: [PATCH] arch, hypervisor, vmm: KvmHyperVisor -> KvmHypervisor "Hypervisor" is one word. The "v" shouldn't be capitalised. No functional change. Signed-off-by: Wei Liu --- arch/src/x86_64/interrupts.rs | 2 +- arch/src/x86_64/regs.rs | 8 ++++---- hypervisor/src/kvm/mod.rs | 28 ++++++++++++++-------------- src/main.rs | 2 +- vmm/src/vm.rs | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/arch/src/x86_64/interrupts.rs b/arch/src/x86_64/interrupts.rs index b6ee8e4c2..391b6b84a 100644 --- a/arch/src/x86_64/interrupts.rs +++ b/arch/src/x86_64/interrupts.rs @@ -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 = Arc::new(kvm); let vm = hv.create_vm().expect("new VM fd creation failed"); assert!(hv.check_capability(hypervisor::kvm::Cap::Irqchip)); diff --git a/arch/src/x86_64/regs.rs b/arch/src/x86_64/regs.rs index 6a45293b3..528a796c0 100644 --- a/arch/src/x86_64/regs.rs +++ b/arch/src/x86_64/regs.rs @@ -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 = 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 = 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 = 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 = Arc::new(kvm); let vm = hv.create_vm().expect("new VM fd creation failed"); let vcpu = vm.create_vcpu(0).unwrap(); diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 25e0b9c5e..1bf25b37b 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -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 = 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 = result::Result; -impl KvmHyperVisor { +impl KvmHypervisor { /// Create a hypervisor based on Kvm - pub fn new() -> hypervisor::Result { + pub fn new() -> hypervisor::Result { 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 = 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> { @@ -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 = 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 = 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 = Arc::new(kvm); /// let vm = hv.create_vm().expect("new VM fd creation failed"); /// vm.enable_split_irq().unwrap(); diff --git a/src/main.rs b/src/main.rs index 84497010a..47a8135fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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; diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index a0d2cbf5c..e9cc41854 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -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 = Arc::new(kvm); let vm_fd = hv.create_vm().expect("new VM fd creation failed");