diff --git a/.taplo.toml b/.taplo.toml index 9bd6f6eee..9e7ab9e99 100644 --- a/.taplo.toml +++ b/.taplo.toml @@ -1,5 +1,5 @@ include = ["**/Cargo.toml"] [formatting] -reoder_arrays = true +reorder_arrays = true reorder_keys = true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a17fa1cd..0750e8bfa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -112,5 +112,5 @@ Fixes #88 Signed-off-by: Sebastien Boeuf ``` -Then, after the corresponding PR is merged, Github will automatically close that issue when parsing the +Then, after the corresponding PR is merged, GitHub will automatically close that issue when parsing the [commit message](https://help.github.com/articles/closing-issues-via-commit-messages/). diff --git a/arch/src/aarch64/fdt.rs b/arch/src/aarch64/fdt.rs index f66d93b5d..1331dcf52 100644 --- a/arch/src/aarch64/fdt.rs +++ b/arch/src/aarch64/fdt.rs @@ -525,7 +525,7 @@ fn create_memory_node( let memory_region_size: u64 = memory_region.size() as u64; mem_reg_prop.push(memory_region_start_addr); mem_reg_prop.push(memory_region_size); - // Set the node address the first non-zero regison address + // Set the node address the first non-zero region address if node_memory_addr == 0 { node_memory_addr = memory_region_start_addr; } @@ -571,7 +571,7 @@ fn create_memory_node( if ram_regions.len() > 2 { panic!( - "There should be up to two non-continuous regions, devidided by the + "There should be up to two non-continuous regions, divided by the gap at the end of 32bit address space." ); } @@ -896,7 +896,7 @@ fn create_pci_nodes( for pci_device_info_elem in pci_device_info.iter() { // EDK2 requires the PCIe high space above 4G address. // The actual space in CLH follows the RAM. If the RAM space is small, the PCIe high space - // could fall bellow 4G. + // could fall below 4G. // Here we cut off PCI device space below 8G in FDT to workaround the EDK2 check. // But the address written in ACPI is not impacted. let (pci_device_base_64bit, pci_device_size_64bit) = diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index afbb25b68..8b24b2209 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -577,7 +577,7 @@ impl CpuidFeatureEntry { if !entry_compatible { error!( "Detected incompatible CPUID entry: leaf={:#02x} (subleaf={:#02x}), register='{:?}', \ - compatilbe_check='{:?}', source VM feature='{:#04x}', destination VM feature'{:#04x}'.", + compatible_check='{:?}', source VM feature='{:#04x}', destination VM feature'{:#04x}'.", entry.function, entry.index, entry.feature_reg, entry.compatible_check, src_vm_feature, dest_vm_feature ); diff --git a/block/src/qcow/mod.rs b/block/src/qcow/mod.rs index 1bb028b4c..4e6b744b2 100644 --- a/block/src/qcow/mod.rs +++ b/block/src/qcow/mod.rs @@ -1200,7 +1200,7 @@ impl QcowFile { } // Allocate and initialize a new data cluster. Returns the offset of the - // cluster in to the file on success. + // cluster into the file on success. fn append_data_cluster(&mut self, initial_data: Option>) -> std::io::Result { let new_addr: u64 = self.get_new_cluster(initial_data)?; // The cluster refcount starts at one indicating it is used but doesn't need COW. diff --git a/block/src/qcow/refcount.rs b/block/src/qcow/refcount.rs index f28c021fd..8e496ff7e 100644 --- a/block/src/qcow/refcount.rs +++ b/block/src/qcow/refcount.rs @@ -28,7 +28,7 @@ pub enum Error { /// `NeedNewCluster` - Handle this error by allocating a cluster and calling the function again. #[error("New cluster needs to be allocated for refcounts")] NeedNewCluster, - /// `ReadingRefCounts` - Error reading the file in to the refcount cache. + /// `ReadingRefCounts` - Error reading the file into the refcount cache. #[error("Failed to read the file into the refcount cache: {0}")] ReadingRefCounts(io::Error), } diff --git a/block/src/vhdx/vhdx_header.rs b/block/src/vhdx/vhdx_header.rs index 40031c8ca..55af64430 100644 --- a/block/src/vhdx/vhdx_header.rs +++ b/block/src/vhdx/vhdx_header.rs @@ -127,7 +127,7 @@ pub struct Header { impl Header { /// Reads the Header structure from a reference VHDx file pub fn new(f: &mut File, start: u64) -> Result
{ - // Read the whole header in to a buffer. We will need it for + // Read the whole header into a buffer. We will need it for // calculating checksum. let mut buffer = [0; HEADER_SIZE as usize]; f.seek(SeekFrom::Start(start)) @@ -470,7 +470,7 @@ impl VhdxHeader { pub fn calculate_checksum(buffer: &mut [u8], csum_offset: usize) -> Result { // Read the checksum into a mutable slice let csum_buf = &mut buffer[csum_offset..csum_offset + 4]; - // Convert the checksum chunk in to a u32 integer + // Convert the checksum chunk into a u32 integer let orig_csum = LittleEndian::read_u32(csum_buf); // Zero the checksum in the buffer LittleEndian::write_u32(csum_buf, 0); diff --git a/devices/src/tpm.rs b/devices/src/tpm.rs index 7a47eee1a..0f6c60704 100644 --- a/devices/src/tpm.rs +++ b/devices/src/tpm.rs @@ -450,7 +450,7 @@ impl BusDevice for Tpm { ); } _ => { - error!("Invalid value passed to CRTL_REQ register"); + error!("Invalid value passed to CTRL_REQ register"); return None; } }, diff --git a/docs/api.md b/docs/api.md index feed35e9c..2b57d0dca 100644 --- a/docs/api.md +++ b/docs/api.md @@ -270,7 +270,7 @@ definition in XML format: ### Command Line Interface The Cloud Hypervisor Command Line Interface (CLI) can only be used for launching -the Cloud Hypervisor binary, i.e. it can not be used for controlling the VMM or +the Cloud Hypervisor binary, i.e. it cannot be used for controlling the VMM or the launched VM once they're up and running. If you want to inspect the VMM, or control the VM after launching Cloud diff --git a/docs/custom-image.md b/docs/custom-image.md index 001375a03..f4aba0dae 100644 --- a/docs/custom-image.md +++ b/docs/custom-image.md @@ -159,10 +159,10 @@ as we might need to update the direct kernel boot command line, replacing Update all references to the previous image name to the new one. -## NVIDIA image for VFIO baremetal CI +## NVIDIA image for VFIO bare-metal CI Here we are going to describe how to create a cloud image that contains the -necessary NVIDIA drivers for our VFIO baremetal CI. +necessary NVIDIA drivers for our VFIO bare-metal CI. ### Download base image diff --git a/docs/fuzzing.md b/docs/fuzzing.md index d6dd9685b..99414af1d 100644 --- a/docs/fuzzing.md +++ b/docs/fuzzing.md @@ -2,7 +2,7 @@ Cloud Hypervisor uses [cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz) for fuzzing individual components. -The fuzzers are are in the `fuzz/fuzz_targets` directory +The fuzzers are in the `fuzz/fuzz_targets` directory ## Preparation diff --git a/docs/hotplug.md b/docs/hotplug.md index abf6ecbc7..86ba9ad63 100644 --- a/docs/hotplug.md +++ b/docs/hotplug.md @@ -53,7 +53,7 @@ On-line CPU(s) list: 0-7 After a reboot the added CPUs will remain. -Removing CPUs works similarly by reducing the number in the "desired_vcpus" field of the reisze API. The CPUs will be automatically offlined inside the guest so there is no need to run any commands inside the guest: +Removing CPUs works similarly by reducing the number in the "desired_vcpus" field of the resize API. The CPUs will be automatically offlined inside the guest so there is no need to run any commands inside the guest: ```shell ./ch-remote --api-socket=/tmp/ch-socket resize --cpus 2 diff --git a/docs/iommu.md b/docs/iommu.md index 6f03cabdf..21d1d30c4 100644 --- a/docs/iommu.md +++ b/docs/iommu.md @@ -39,7 +39,7 @@ Another reason for having a virtual IOMMU is to allow passing physical devices from the host through multiple layers of virtualization. Let's take as example a system with a physical IOMMU running a VM with a virtual IOMMU. The implementation of the virtual IOMMU is responsible for updating the physical -DMA Remapping table (DMAR) everytime the DMA mapping changes. This must happen +DMA Remapping table (DMAR) every time the DMA mapping changes. This must happen through the VFIO framework on the host as this is the only userspace interface to interact with a physical IOMMU. @@ -124,7 +124,7 @@ On AArch64 architecture, the virtual IOMMU can still be used even if ACPI is not enabled. But the effect is different with what the aforementioned test showed. When ACPI is disabled, virtual IOMMU is supported through Flattened Device Tree -(FDT). In this case, the guest kernel can not tell which device should be +(FDT). In this case, the guest kernel cannot tell which device should be IOMMU-attached and which should not. No matter how many devices you attached to the virtual IOMMU by setting `iommu=on` option, all the devices on the PCI bus will be attached to the virtual IOMMU (except the IOMMU itself). Each of the diff --git a/docs/memory.md b/docs/memory.md index 971bc4903..46569449c 100644 --- a/docs/memory.md +++ b/docs/memory.md @@ -466,7 +466,7 @@ List of virtual CPUs attached to the guest NUMA node identified by the `guest_numa_id` option. This allows for describing a list of CPUs which must be seen by the guest as belonging to the NUMA node `guest_numa_id`. -One can use this option for a fine grained description of the NUMA topology +One can use this option for a fine-grained description of the NUMA topology regarding the CPUs associated with it, which might help the guest run more efficiently. @@ -573,7 +573,7 @@ _Example_ ### PCI bus Cloud Hypervisor supports guests with one or more PCI segments. The default PCI segment always -has affinity to NUMA node 0. Be default, all other PCI segments have afffinity to NUMA node 0. +has affinity to NUMA node 0. Be default, all other PCI segments have affinity to NUMA node 0. The user may configure the NUMA affinity for any additional PCI segments. _Example_ diff --git a/docs/releases.md b/docs/releases.md index 11b694654..b8a40bbbb 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -95,7 +95,7 @@ E - EOL ``` -### LTS Stablity Considerations +### LTS Stability Considerations An LTS release is just a `MAJOR` release for which point releases are made for longer following the same rules for what can be backported to a `POINT` release. diff --git a/docs/tracing.md b/docs/tracing.md index a96c17b73..fa68679f0 100644 --- a/docs/tracing.md +++ b/docs/tracing.md @@ -37,6 +37,6 @@ generating traces of the boot. These can be relocated for focus tracing on a narrow part of the code base. A `tracer::trace_point!()` macro is also provided for an instantaneous trace -point however this is not in use in the code base currently nor is handled by +point however this is neither in use in the code base currently nor is handled by the visualisation script due to the difficulty in representation in the SVG. diff --git a/hypervisor/src/arch/x86/emulator/mod.rs b/hypervisor/src/arch/x86/emulator/mod.rs index 632a3c5f6..2c41b6cd7 100644 --- a/hypervisor/src/arch/x86/emulator/mod.rs +++ b/hypervisor/src/arch/x86/emulator/mod.rs @@ -135,7 +135,7 @@ pub trait CpuStateManager: Clone { .checked_add(segment_register.base) .ok_or_else(|| { PlatformError::InvalidAddress(anyhow!( - "Logical address {:#x} can not be linearized with segment {:#x?}", + "Logical address {:#x} cannot be linearized with segment {:#x?}", logical_addr, segment_register )) @@ -148,7 +148,7 @@ pub trait CpuStateManager: Clone { // Must not write to a read-only segment. if segment_type_ro(segment_type) && write { return Err(PlatformError::InvalidAddress(anyhow!( - "Can not write to a read-only segment" + "Cannot write to a read-only segment" ))); } diff --git a/hypervisor/src/hypervisor.rs b/hypervisor/src/hypervisor.rs index a2044f580..a893239be 100644 --- a/hypervisor/src/hypervisor.rs +++ b/hypervisor/src/hypervisor.rs @@ -166,7 +166,7 @@ pub trait Hypervisor: Send + Sync { CpuVendor::AMD } else { // Not known yet, the corresponding manufacturer manual should contain the - // necesssary info. See also https://wiki.osdev.org/CPUID#CPU_Vendor_ID_String + // necessary info. See also https://wiki.osdev.org/CPUID#CPU_Vendor_ID_String CpuVendor::default() } } diff --git a/hypervisor/src/kvm/aarch64/gic/redist_regs.rs b/hypervisor/src/kvm/aarch64/gic/redist_regs.rs index 81fe5678d..4ff17ac5d 100644 --- a/hypervisor/src/kvm/aarch64/gic/redist_regs.rs +++ b/hypervisor/src/kvm/aarch64/gic/redist_regs.rs @@ -46,7 +46,7 @@ const KVM_ARM64_SYSREG_MPIDR_EL1: u64 = KVM_REG_ARM64 | (((5_u64) << KVM_REG_ARM64_SYSREG_OP2_SHIFT) & KVM_REG_ARM64_SYSREG_OP2_MASK as u64); /// This is how we represent the registers of a distributor. -/// It is relrvant their offset from the base address of the +/// It is relevant their offset from the base address of the /// distributor. /// Each register has a different number /// of bits_per_irq and is therefore variable length. diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 2ff93aa14..a2df76769 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -535,9 +535,9 @@ impl vm::Vm for KvmVm { if self.check_extension(crate::kvm::Cap::MsiDevid) { // On AArch64, there is limitation on the range of the 'devid', - // it can not be greater than 65536 (the max of u16). + // it cannot be greater than 65536 (the max of u16). // - // BDF can not be used directly, because 'segment' is in high + // BDF cannot be used directly, because 'segment' is in high // 16 bits. The layout of the u32 BDF is: // |---- 16 bits ----|-- 8 bits --|-- 5 bits --|-- 3 bits --| // | segment | bus | device | function | @@ -1505,7 +1505,7 @@ impl cpu::Vcpu for KvmVcpu { #[cfg(target_arch = "x86_64")] /// - /// Set the floating point state (FPU) of a vCPU using the `KVM_SET_FPU` ioct. + /// Set the floating point state (FPU) of a vCPU using the `KVM_SET_FPU` ioctl. /// fn set_fpu(&self, fpu: &FpuState) -> cpu::Result<()> { let fpu: kvm_bindings::kvm_fpu = (*fpu).clone().into(); @@ -1986,7 +1986,7 @@ impl cpu::Vcpu for KvmVcpu { /// SREGS saves/restores a pending interrupt, similar to what /// VCPU_EVENTS also does. /// - /// GET_MSRS requires a pre-populated data structure to do something + /// GET_MSRS requires a prepopulated data structure to do something /// meaningful. For SET_MSRS it will then contain good data. /// /// # Example diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index d0dd5c3a3..1889de570 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -1329,7 +1329,7 @@ impl cpu::Vcpu for MshvVcpu { self.set_fpu(&state.fpu)?; self.set_xcrs(&state.xcrs)?; // These registers are global and needed to be set only for first VCPU - // as Microsoft Hypervisor allows setting this regsier for only one VCPU + // as Microsoft Hypervisor allows setting this register for only one VCPU if self.vp_index == 0 { self.fd .set_misc_regs(&state.misc) diff --git a/hypervisor/src/vm.rs b/hypervisor/src/vm.rs index ed15ed9db..68906bdb0 100644 --- a/hypervisor/src/vm.rs +++ b/hypervisor/src/vm.rs @@ -190,7 +190,7 @@ pub enum HypervisorVmError { /// Assert virtual interrupt error /// #[error("Failed to assert virtual Interrupt: {0}")] - AsserttVirtualInterrupt(#[source] anyhow::Error), + AssertVirtualInterrupt(#[source] anyhow::Error), #[cfg(feature = "sev_snp")] /// diff --git a/net_util/src/queue_pair.rs b/net_util/src/queue_pair.rs index d6ff0fd9e..78f804d47 100644 --- a/net_util/src/queue_pair.rs +++ b/net_util/src/queue_pair.rs @@ -418,7 +418,7 @@ impl NetQueuePair { .map_or(false, |r| r.is_blocked()); // Stop listening on the `RX_TAP_EVENT` when: - // 1) there is no available describles, or + // 1) there is no available describes, or // 2) the RX rate limit is reached. if self.rx_tap_listening && (!self.rx_desc_avail || rate_limit_reached) { unregister_listener( diff --git a/pci/src/configuration.rs b/pci/src/configuration.rs index 1717d8c92..589595bd8 100644 --- a/pci/src/configuration.rs +++ b/pci/src/configuration.rs @@ -291,7 +291,7 @@ pub enum PciExpressCapabilityId { VfResizeableBar = 0x0024, DataLinkFeature = 0x0025, PhysicalLayerSixteenGts = 0x0026, - LaneMargeningAtTheReceiver = 0x0027, + LaneMarginingAtTheReceiver = 0x0027, HierarchyId = 0x0028, NativePcieEnclosureManagement = 0x0029, PhysicalLayerThirtyTwoGts = 0x002a, @@ -345,7 +345,7 @@ impl From for PciExpressCapabilityId { 0x0024 => PciExpressCapabilityId::VfResizeableBar, 0x0025 => PciExpressCapabilityId::DataLinkFeature, 0x0026 => PciExpressCapabilityId::PhysicalLayerSixteenGts, - 0x0027 => PciExpressCapabilityId::LaneMargeningAtTheReceiver, + 0x0027 => PciExpressCapabilityId::LaneMarginingAtTheReceiver, 0x0028 => PciExpressCapabilityId::HierarchyId, 0x0029 => PciExpressCapabilityId::NativePcieEnclosureManagement, 0x002a => PciExpressCapabilityId::PhysicalLayerThirtyTwoGts, diff --git a/pci/src/device.rs b/pci/src/device.rs index 43d86cd5b..905dbd1b2 100644 --- a/pci/src/device.rs +++ b/pci/src/device.rs @@ -79,7 +79,7 @@ pub trait PciDevice: BusDevice { /// Sets a register in the configuration space. /// * `reg_idx` - The index of the config register to modify. - /// * `offset` - Offset in to the register. + /// * `offset` - Offset into the register. fn write_config_register( &mut self, reg_idx: usize, @@ -97,11 +97,11 @@ pub trait PciDevice: BusDevice { ) -> Option { None } - /// Reads from a BAR region mapped in to the device. + /// Reads from a BAR region mapped into the device. /// * `addr` - The guest address inside the BAR. /// * `data` - Filled with the data from `addr`. fn read_bar(&mut self, _base: u64, _offset: u64, _data: &mut [u8]) {} - /// Writes to a BAR region mapped in to the device. + /// Writes to a BAR region mapped into the device. /// * `addr` - The guest address inside the BAR. /// * `data` - The data to write. fn write_bar(&mut self, _base: u64, _offset: u64, _data: &[u8]) -> Option> { diff --git a/performance-metrics/src/performance_tests.rs b/performance-metrics/src/performance_tests.rs index ade33f2b9..2b0fc9eba 100644 --- a/performance-metrics/src/performance_tests.rs +++ b/performance-metrics/src/performance_tests.rs @@ -34,7 +34,7 @@ impl From for Error { const BLK_IO_TEST_IMG: &str = "/var/tmp/ch-blk-io-test.img"; pub fn init_tests() { - // The test image can not be created on tmpfs (e.g. /tmp) filesystem, + // The test image cannot be created on tmpfs (e.g. /tmp) filesystem, // as tmpfs does not support O_DIRECT assert!(exec_host_command_output(&format!( "dd if=/dev/zero of={BLK_IO_TEST_IMG} bs=1M count=4096" @@ -199,7 +199,7 @@ fn parse_boot_time_output(output: &[u8]) -> Result { ); assert!( t[7].eq("seconds"), - "Expecting 'seconds' as the the last word of the 'Debug I/O port' output" + "Expecting 'seconds' as the last word of the 'Debug I/O port' output" ); t[6].parse::().unwrap() @@ -226,7 +226,7 @@ fn parse_boot_time_output(output: &[u8]) -> Result { ); assert!( t[7].eq("seconds"), - "Expecting 'seconds' as the the last word of the 'Debug I/O port' output" + "Expecting 'seconds' as the last word of the 'Debug I/O port' output" ); t[6].parse::().unwrap() diff --git a/release-notes.md b/release-notes.md index e0ef3a47d..446123450 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1081,7 +1081,7 @@ releases of the LTS. ### Virtualised TPM Support -Support for adding an emulated CRB TPM has been added. This has it's own [TPM +Support for adding an emulated CRB TPM has been added. This has its own [TPM documentation](docs/tpm.md). ### Transparent Huge Page Support @@ -1272,7 +1272,7 @@ plan to use alternatives. The following functionality has been removed: * The unused `poll_queue` parameter has been removed from `--disk` and - equivalent. This was residual from the the removal of the `vhost-user-block` + equivalent. This was residual from the removal of the `vhost-user-block` spawning feature (#4402.) ### Contributors @@ -2094,19 +2094,19 @@ Deprecated features will be removed in a subsequent release and users should pla Many thanks to everyone who has contributed to our 0.14.0 release including some new faces. -Bo Chen -Henry Wang -Iggy Jackson -Jiachen Zhang -Michael Zhao -Muminul Islam -Penny Zheng -Rob Bradford -Sebastien Boeuf -Vineeth Pillai -Wei Liu -William Douglas -Zide Chen +* Bo Chen +* Henry Wang +* Iggy Jackson +* Jiachen Zhang +* Michael Zhao +* Muminul Islam +* Penny Zheng +* Rob Bradford +* Sebastien Boeuf +* Vineeth Pillai +* Wei Liu +* William Douglas +* Zide Chen # v0.13.0 @@ -2191,7 +2191,7 @@ removed. ### Migration of `vhost-user-fs` backend The `vhost-user-fs` backend is no longer included in Cloud Hypervisor and it is -instead hosted in [it's own +instead hosted in [its own repository](https://gitlab.com/virtio-fs/virtiofsd-rs) ### Enhanced "info" API @@ -2325,7 +2325,7 @@ Some `virtio-block` device drivers may generate requests with multiple descripto ### Memory Zones -Support has been added for fine grained control of memory allocation for the guest. This includes controlling the backing of sections of guest memory, assigning to specific host NUMA nodes and assigning memory and vCPUs to specific memory nodes inside the guest. Full details of this can be found in the [memory documentation](docs/memory.md). +Support has been added for fine-grained control of memory allocation for the guest. This includes controlling the backing of sections of guest memory, assigning to specific host NUMA nodes and assigning memory and vCPUs to specific memory nodes inside the guest. Full details of this can be found in the [memory documentation](docs/memory.md). ### `Seccomp` Sandbox Improvements diff --git a/scripts/run_integration_tests_vfio.sh b/scripts/run_integration_tests_vfio.sh index 38600e810..4d7bac60a 100755 --- a/scripts/run_integration_tests_vfio.sh +++ b/scripts/run_integration_tests_vfio.sh @@ -3,7 +3,7 @@ set -x # This set of vfio tests require to be ran on a specific machine with -# specific hardware (e.g. the "vfio" bera-metal worker equipped with a +# specific hardware (e.g. the "vfio" bare-metal worker equipped with a # Nvidia Tesla T4 card). So the provisioning of the running machine is # out of the scope of this script, including the custom guest image with # Nvidia drivers installed, and properly configured Nvidia Tesla T4 card. diff --git a/src/main.rs b/src/main.rs index 17794a2ee..68f951e95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -797,10 +797,10 @@ fn start_vmm(cmd_arguments: ArgMatches) -> Result, Error> { // This is a best-effort solution to the latency induced by the RCU // synchronization that happens in the kernel whenever the file descriptor table // fills up. -// The table has initially 64 entries on amd64 and everytime it fills up, a new +// The table has initially 64 entries on amd64 and every time it fills up, a new // table is created, double the size of the current one, and the entries are // copied to the new table. The filesystem code that does this uses -// synchronize_rcu() to ensure all pre-existing RCU read-side critical sections +// synchronize_rcu() to ensure all preexisting RCU read-side critical sections // have completed: // // https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/fs/file.c?h=v6.9.1#n162 diff --git a/test_infra/src/lib.rs b/test_infra/src/lib.rs index 09a1e6d45..b131720bb 100644 --- a/test_infra/src/lib.rs +++ b/test_infra/src/lib.rs @@ -264,7 +264,7 @@ impl DiskConfig for UbuntuDiskConfig { fs::File::open(source_file_dir.join("user-data")) .unwrap() .read_to_string(&mut user_data_string) - .expect("Expected reading user-data file in to succeed"); + .expect("Expected reading user-data file to succeed"); user_data_string = user_data_string.replace( "@DEFAULT_TCP_LISTENER_MESSAGE", DEFAULT_TCP_LISTENER_MESSAGE, @@ -283,7 +283,7 @@ impl DiskConfig for UbuntuDiskConfig { fs::File::open(source_file_dir.join("network-config")) .unwrap() .read_to_string(&mut network_config_string) - .expect("Expected reading network-config file in to succeed"); + .expect("Expected reading network-config file to succeed"); network_config_string = network_config_string.replace("192.168.2.1", &network.host_ip); network_config_string = network_config_string.replace("192.168.2.2", &network.guest_ip); @@ -1622,7 +1622,7 @@ pub fn measure_virtio_net_throughput( } if !failed { - // Safe to unwrap as we know the child has terminated succesffully + // Safe to unwrap as we know the child has terminated successfully let output = c.wait_with_output().unwrap(); results.push(parse_iperf3_output(&output.stdout, receive, bandwidth)?); } else { diff --git a/tests/integration.rs b/tests/integration.rs index 74bb20bcb..96bd5bd45 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -9061,7 +9061,7 @@ mod live_migration { dest_api_socket: &str, local: bool, ) -> bool { - // Start to receive migration from the destintion VM + // Start to receive migration from the destination VM let mut receive_migration = Command::new(clh_command("ch-remote")) .args([ &format!("--api-socket={dest_api_socket}"), @@ -9258,7 +9258,7 @@ mod live_migration { let r = std::panic::catch_unwind(|| { guest.wait_vm_boot(None).unwrap(); - // Make sure the source VM is functaionl + // Make sure the source VM is functional // Check the number of vCPUs assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); @@ -9326,7 +9326,7 @@ mod live_migration { ); }; - // Post live-migration check to make sure the destination VM is funcational + // Post live-migration check to make sure the destination VM is functional let r = std::panic::catch_unwind(|| { // Perform same checks to validate VM has been properly migrated assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); @@ -9340,7 +9340,7 @@ mod live_migration { let dest_output = dest_child.wait_with_output().unwrap(); handle_child_output(r, &dest_output); - // Check the destination VM has the expected 'concole_text' from its output + // Check the destination VM has the expected 'console_text' from its output let r = std::panic::catch_unwind(|| { assert!(String::from_utf8_lossy(&dest_output.stdout).contains(&console_text)); }); @@ -9422,7 +9422,7 @@ mod live_migration { let r = std::panic::catch_unwind(|| { guest.wait_vm_boot(None).unwrap(); - // Make sure the source VM is functaionl + // Make sure the source VM is functional // Check the number of vCPUs assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); @@ -9500,7 +9500,7 @@ mod live_migration { ); }; - // Post live-migration check to make sure the destination VM is funcational + // Post live-migration check to make sure the destination VM is functional let r = std::panic::catch_unwind(|| { // Perform same checks to validate VM has been properly migrated assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); @@ -9529,7 +9529,7 @@ mod live_migration { let dest_output = dest_child.wait_with_output().unwrap(); handle_child_output(r, &dest_output); - // Check the destination VM has the expected 'concole_text' from its output + // Check the destination VM has the expected 'console_text' from its output let r = std::panic::catch_unwind(|| { assert!(String::from_utf8_lossy(&dest_output.stdout).contains(&console_text)); }); @@ -9623,7 +9623,7 @@ mod live_migration { let r = std::panic::catch_unwind(|| { guest.wait_vm_boot(None).unwrap(); - // Make sure the source VM is functaionl + // Make sure the source VM is functional // Check the number of vCPUs assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); @@ -9718,7 +9718,7 @@ mod live_migration { ); }; - // Post live-migration check to make sure the destination VM is funcational + // Post live-migration check to make sure the destination VM is functional let r = std::panic::catch_unwind(|| { // Perform same checks to validate VM has been properly migrated assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); @@ -9776,7 +9776,7 @@ mod live_migration { let dest_output = dest_child.wait_with_output().unwrap(); handle_child_output(r, &dest_output); - // Check the destination VM has the expected 'concole_text' from its output + // Check the destination VM has the expected 'console_text' from its output let r = std::panic::catch_unwind(|| { assert!(String::from_utf8_lossy(&dest_output.stdout).contains(&console_text)); }); @@ -9849,7 +9849,7 @@ mod live_migration { let r = std::panic::catch_unwind(|| { guest.wait_vm_boot(None).unwrap(); - // Make sure the source VM is functaionl + // Make sure the source VM is functional // Check the number of vCPUs assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); // Check the guest RAM @@ -9934,7 +9934,7 @@ mod live_migration { ); }; - // Post live-migration check to make sure the destination VM is funcational + // Post live-migration check to make sure the destination VM is functional let r = std::panic::catch_unwind(|| { // Perform same checks to validate VM has been properly migrated assert_eq!(guest.get_cpu_count().unwrap_or_default(), boot_vcpus); @@ -9975,7 +9975,7 @@ mod live_migration { let dest_output = dest_child.wait_with_output().unwrap(); handle_child_output(r, &dest_output); - // Check the destination VM has the expected 'concole_text' from its output + // Check the destination VM has the expected 'console_text' from its output let r = std::panic::catch_unwind(|| { assert!(String::from_utf8_lossy(&dest_output.stdout).contains(&console_text)); }); @@ -10044,7 +10044,7 @@ mod live_migration { ); }; - // Post live-migration check to make sure the destination VM is funcational + // Post live-migration check to make sure the destination VM is functional let r = std::panic::catch_unwind(|| { // Perform same checks to validate VM has been properly migrated // Spawn a new netcat listener in the OVS VM @@ -10126,7 +10126,7 @@ mod live_migration { mod live_migration_sequential { use super::*; - // NUMA & baalloon live migration tests are large so run sequentially + // NUMA & balloon live migration tests are large so run sequentially #[test] fn test_live_migration_balloon() { diff --git a/tpm/src/emulator.rs b/tpm/src/emulator.rs index 805637221..53fdc371e 100644 --- a/tpm/src/emulator.rs +++ b/tpm/src/emulator.rs @@ -181,7 +181,7 @@ impl Emulator { Ok(()) } - /// Check if minimum set of capabitlies are supported + /// Check if minimum set of capabilities are supported fn check_caps(&mut self) -> bool { /* min. required capabilities for TPM 2.0*/ let caps: PtmCap = PTM_CAP_INIT @@ -254,7 +254,7 @@ impl Emulator { let mut output = [0u8; 16]; - // Every Control Cmd gets atleast a result code in response. Read it + // Every Control Cmd gets at least a result code in response. Read it let read_size = self.control_socket.read(&mut output).map_err(|e| { Error::RunControlCmd(anyhow!( "Failed while reading response for Control Cmd: {:02X?}. Error: {:?}", diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index d7616bf8f..b8302bbe2 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -247,7 +247,7 @@ impl BlockEpollHandler { #[inline] fn find_inflight_request(&mut self, completed_head: u16) -> Result { // This loop neatly handles the fast path where the completions are - // in order (it turng into just a pop_front()) and the 1% of the time + // in order (it turns into just a pop_front()) and the 1% of the time // (analysis during boot) where slight out of ordering has been // observed e.g. // Submissions: 1 2 3 4 5 6 7 diff --git a/virtio-devices/src/vsock/mod.rs b/virtio-devices/src/vsock/mod.rs index 1b2a473e3..2dbf96c99 100644 --- a/virtio-devices/src/vsock/mod.rs +++ b/virtio-devices/src/vsock/mod.rs @@ -126,7 +126,7 @@ pub trait VsockEpollListener { /// Get the set of events for which the listener wants to be notified. fn get_polled_evset(&self) -> epoll::Events; - /// Notify the listener that one ore more events have occurred. + /// Notify the listener that one or more events have occurred. fn notify(&mut self, evset: epoll::Events); } diff --git a/virtio-devices/src/vsock/packet.rs b/virtio-devices/src/vsock/packet.rs index ce3422473..f39374f5d 100644 --- a/virtio-devices/src/vsock/packet.rs +++ b/virtio-devices/src/vsock/packet.rs @@ -141,7 +141,7 @@ impl VsockPacket { buf_size: 0, }; - // No point looking for a data/buffer descriptor, if the packet is zero-lengthed. + // No point looking for a data/buffer descriptor, if the packet is zero-length. if pkt.is_empty() { return Ok(pkt); } diff --git a/virtio-devices/src/vsock/unix/muxer.rs b/virtio-devices/src/vsock/unix/muxer.rs index 89dd2511e..59bac4e70 100644 --- a/virtio-devices/src/vsock/unix/muxer.rs +++ b/virtio-devices/src/vsock/unix/muxer.rs @@ -32,7 +32,7 @@ //! `VsockConnection`. //! //! The muxer gets notified about all of these events, because, as a `VsockEpollListener` -//! implementor, it gets to register a nested epoll FD into the main VMM epolling loop. All +//! implementor, it gets to register a nested epoll FD into the main VMM epoll()ing loop. All //! other pollable FDs are then registered under this nested epoll FD. //! //! To route all these events to their handlers, the muxer uses another `HashMap` object, diff --git a/vmm/src/api/mod.rs b/vmm/src/api/mod.rs index de68e23e2..26c9e22d6 100644 --- a/vmm/src/api/mod.rs +++ b/vmm/src/api/mod.rs @@ -151,7 +151,7 @@ pub enum ApiError { /// The vsock device could not be added to the VM. VmAddVsock(VmError), - /// Error starting migration receiever + /// Error starting migration receiver VmReceiveMigration(MigratableError), /// Error starting migration sender diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 8eca9ab43..24d2e3e83 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -2488,7 +2488,7 @@ impl VmConfig { return Err(ValidationError::CpuTopologyZeroPart); } - // The setting of dies doesen't apply on AArch64. + // The setting of dies doesn't apply on AArch64. // Only '1' value is accepted, so its impact on the vcpu topology // setting can be ignored. #[cfg(target_arch = "aarch64")] diff --git a/vmm/src/lib.rs b/vmm/src/lib.rs index df76d5d64..752f0275b 100644 --- a/vmm/src/lib.rs +++ b/vmm/src/lib.rs @@ -1220,7 +1220,7 @@ impl RequestHandler for Vmm { event!("vm", "booting"); let r = { trace_scoped!("vm_boot"); - // If we don't have a config, we can not boot a VM. + // If we don't have a config, we cannot boot a VM. if self.vm_config.is_none() { return Err(VmError::VmMissingConfig); }; diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index 5729677b1..09edbd991 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -1766,7 +1766,7 @@ impl MemoryManager { }; if ret != 0 { let e = io::Error::last_os_error(); - warn!("Failed to mark mappin as MADV_DONTDUMP: {}", e); + warn!("Failed to mark mapping as MADV_DONTDUMP: {}", e); } // Mark the pages as mergeable if explicitly asked for.