diff --git a/src/libs/kata-types/src/annotations/mod.rs b/src/libs/kata-types/src/annotations/mod.rs index 43f23e727..27103ef62 100644 --- a/src/libs/kata-types/src/annotations/mod.rs +++ b/src/libs/kata-types/src/annotations/mod.rs @@ -325,12 +325,12 @@ impl Annotation { } /// Get an immutable reference to the annotation hashmap. - pub fn get_annotation(&self) -> &HashMap { + pub fn get_annotations(&self) -> &HashMap { &self.annotations } /// Get a mutable reference to the annotation hashmap. - pub fn get_annotation_mut(&mut self) -> &mut HashMap { + pub fn get_annotations_mut(&mut self) -> &mut HashMap { &mut self.annotations } @@ -609,7 +609,7 @@ impl Annotation { return Err(io::Error::new( io::ErrorKind::InvalidData, format!( - "Memory specified in annotation {} is less than minmum required {}", + "Memory specified in annotation {} is less than minimum required {}", mem, get_hypervisor_plugin(hypervisor_name) .unwrap() @@ -627,7 +627,7 @@ impl Annotation { None => { return Err(io::Error::new( io::ErrorKind::InvalidData, - format!("{}in annotation is less than zero", key), + format!("{} in annotation is less than zero", key), )); } }, @@ -715,7 +715,7 @@ impl Annotation { _ => { return Err(io::Error::new( io::ErrorKind::InvalidInput, - format!("Invalid Annotation Type {}", key), + format!("Invalid annotation type {}", key), )); } } diff --git a/src/libs/kata-types/src/config/agent.rs b/src/libs/kata-types/src/config/agent.rs index 9f4f0abbb..82d3eb72f 100644 --- a/src/libs/kata-types/src/config/agent.rs +++ b/src/libs/kata-types/src/config/agent.rs @@ -51,7 +51,7 @@ pub struct Agent { #[serde(default)] pub kernel_modules: Vec, - /// contianer pipe size + /// container pipe size pub container_pipe_size: u32, } diff --git a/src/libs/kata-types/src/config/default.rs b/src/libs/kata-types/src/config/default.rs index 829a1d7dd..b5b4029fb 100644 --- a/src/libs/kata-types/src/config/default.rs +++ b/src/libs/kata-types/src/config/default.rs @@ -35,8 +35,8 @@ pub const DEFAULT_GUEST_HOOK_PATH: &str = "/opt"; pub const DEFAULT_GUEST_VCPUS: u32 = 1; // Default configuration for Dragonball -pub const DEFAULT_DB_GUEST_KENREL_IMAGE: &str = "vmlinuz"; -pub const DEFAULT_DB_GUEST_KENREL_PARAMS: &str = ""; +pub const DEFAULT_DB_GUEST_KERNEL_IMAGE: &str = "vmlinuz"; +pub const DEFAULT_DB_GUEST_KERNEL_PARAMS: &str = ""; pub const DEFAULT_DB_ENTROPY_SOURCE: &str = "/dev/urandom"; pub const DEFAULT_DB_MEMORY_SIZE: u32 = 128; pub const DEFAULT_DB_MEMORY_SLOTS: u32 = 128; @@ -47,8 +47,8 @@ pub const DEFAULT_QEMU_BINARY_PATH: &str = "qemu"; pub const DEFAULT_QEMU_CONTROL_PATH: &str = ""; pub const DEFAULT_QEMU_MACHINE_TYPE: &str = "q35"; pub const DEFAULT_QEMU_ENTROPY_SOURCE: &str = "/dev/urandom"; -pub const DEFAULT_QEMU_GUEST_KENREL_IMAGE: &str = "vmlinuz"; -pub const DEFAULT_QEMU_GUEST_KENREL_PARAMS: &str = ""; +pub const DEFAULT_QEMU_GUEST_KERNEL_IMAGE: &str = "vmlinuz"; +pub const DEFAULT_QEMU_GUEST_KERNEL_PARAMS: &str = ""; pub const DEFAULT_QEMU_FIRMWARE_PATH: &str = ""; pub const DEFAULT_QEMU_MEMORY_SIZE: u32 = 128; pub const DEFAULT_QEMU_MEMORY_SLOTS: u32 = 128; diff --git a/src/libs/kata-types/src/config/hypervisor/dragonball.rs b/src/libs/kata-types/src/config/hypervisor/dragonball.rs index c0b553c22..95158019f 100644 --- a/src/libs/kata-types/src/config/hypervisor/dragonball.rs +++ b/src/libs/kata-types/src/config/hypervisor/dragonball.rs @@ -54,10 +54,10 @@ impl ConfigPlugin for DragonballConfig { resolve_path!(db.jailer_path, "Dragonball jailer path {} is invalid: {}")?; if db.boot_info.kernel.is_empty() { - db.boot_info.kernel = default::DEFAULT_DB_GUEST_KENREL_IMAGE.to_string(); + db.boot_info.kernel = default::DEFAULT_DB_GUEST_KERNEL_IMAGE.to_string(); } if db.boot_info.kernel_params.is_empty() { - db.boot_info.kernel_params = default::DEFAULT_DB_GUEST_KENREL_PARAMS.to_string(); + db.boot_info.kernel_params = default::DEFAULT_DB_GUEST_KERNEL_PARAMS.to_string(); } if db.cpu_info.default_maxvcpus > default::MAX_DB_VCPUS { diff --git a/src/libs/kata-types/src/config/hypervisor/mod.rs b/src/libs/kata-types/src/config/hypervisor/mod.rs index 4e083f9ba..da8e20650 100644 --- a/src/libs/kata-types/src/config/hypervisor/mod.rs +++ b/src/libs/kata-types/src/config/hypervisor/mod.rs @@ -336,7 +336,7 @@ pub struct DebugInfo { /// exist. The dumped file(also called vmcore) can be processed with crash or gdb. /// /// # WARNING: - /// Dump guest’s memory can take very long depending on the amount of guest memory and use + /// Dump guest's memory can take very long depending on the amount of guest memory and use /// much disk space. #[serde(default)] pub guest_memory_dump_path: String, @@ -415,7 +415,7 @@ impl DeviceInfo { pub fn validate(&self) -> Result<()> { if self.default_bridges > 5 { return Err(eother!( - "The configured PCI bridges {} is too big", + "The configured PCI bridges {} are too many", self.default_bridges )); } @@ -479,7 +479,7 @@ impl MachineInfo { /// Validate the configuration information. pub fn validate(&self) -> Result<()> { for pflash in self.pflashes.iter() { - validate_path!(*pflash, "Flash image file {} is invalide: {}")?; + validate_path!(*pflash, "Flash image file {} is invalid: {}")?; } validate_path!(self.entropy_source, "Entropy source {} is invalid: {}")?; Ok(()) @@ -578,10 +578,10 @@ impl MemoryInfo { "Memory backend file {} is invalid: {}" )?; if self.default_memory == 0 { - return Err(eother!("Configured memory size for guest vm is zero")); + return Err(eother!("Configured memory size for guest VM is zero")); } if self.memory_slots == 0 { - return Err(eother!("Configured memory slots for guest vm is zero")); + return Err(eother!("Configured memory slots for guest VM are zero")); } Ok(()) diff --git a/src/libs/kata-types/src/config/hypervisor/qemu.rs b/src/libs/kata-types/src/config/hypervisor/qemu.rs index 6c59f54e9..eb14779bd 100644 --- a/src/libs/kata-types/src/config/hypervisor/qemu.rs +++ b/src/libs/kata-types/src/config/hypervisor/qemu.rs @@ -61,11 +61,11 @@ impl ConfigPlugin for QemuConfig { resolve_path!(qemu.ctlpath, "Qemu ctlpath `{}` is invalid: {}")?; if qemu.boot_info.kernel.is_empty() { - qemu.boot_info.kernel = default::DEFAULT_QEMU_GUEST_KENREL_IMAGE.to_string(); + qemu.boot_info.kernel = default::DEFAULT_QEMU_GUEST_KERNEL_IMAGE.to_string(); } if qemu.boot_info.kernel_params.is_empty() { qemu.boot_info.kernel_params = - default::DEFAULT_QEMU_GUEST_KENREL_PARAMS.to_string(); + default::DEFAULT_QEMU_GUEST_KERNEL_PARAMS.to_string(); } if qemu.boot_info.firmware.is_empty() { qemu.boot_info.firmware = default::DEFAULT_QEMU_FIRMWARE_PATH.to_string(); @@ -99,10 +99,10 @@ impl ConfigPlugin for QemuConfig { /// Validate the configuration information. fn validate(&self, conf: &TomlConfig) -> Result<()> { if let Some(qemu) = conf.hypervisor.get(HYPERVISOR_NAME_QEMU) { - validate_path!(qemu.path, "Qemu binary path `{}` is invalid: {}")?; - validate_path!(qemu.ctlpath, "Qemu control path `{}` is invalid: {}")?; + validate_path!(qemu.path, "QEMU binary path `{}` is invalid: {}")?; + validate_path!(qemu.ctlpath, "QEMU control path `{}` is invalid: {}")?; if !qemu.jailer_path.is_empty() { - return Err(eother!("Path for Qemu jailer should be empty")); + return Err(eother!("Path for QEMU jailer should be empty")); } if !qemu.valid_jailer_paths.is_empty() { return Err(eother!("Valid Qemu jailer path list should be empty"));