Skip to content

Commit

Permalink
libs/types: fixed spelling and grammer error
Browse files Browse the repository at this point in the history
fixed spelling and grammer error in some files

Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
  • Loading branch information
Tim-0731-Hzt authored and Fupan Li committed Jun 10, 2022
1 parent 2599a06 commit 45e5780
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions src/libs/kata-types/src/annotations/mod.rs
Expand Up @@ -325,12 +325,12 @@ impl Annotation {
}

/// Get an immutable reference to the annotation hashmap.
pub fn get_annotation(&self) -> &HashMap<String, String> {
pub fn get_annotations(&self) -> &HashMap<String, String> {
&self.annotations
}

/// Get a mutable reference to the annotation hashmap.
pub fn get_annotation_mut(&mut self) -> &mut HashMap<String, String> {
pub fn get_annotations_mut(&mut self) -> &mut HashMap<String, String> {
&mut self.annotations
}

Expand Down Expand Up @@ -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()
Expand All @@ -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),
));
}
},
Expand Down Expand Up @@ -715,7 +715,7 @@ impl Annotation {
_ => {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
format!("Invalid Annotation Type {}", key),
format!("Invalid annotation type {}", key),
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/kata-types/src/config/agent.rs
Expand Up @@ -51,7 +51,7 @@ pub struct Agent {
#[serde(default)]
pub kernel_modules: Vec<String>,

/// contianer pipe size
/// container pipe size
pub container_pipe_size: u32,
}

Expand Down
8 changes: 4 additions & 4 deletions src/libs/kata-types/src/config/default.rs
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/libs/kata-types/src/config/hypervisor/dragonball.rs
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions src/libs/kata-types/src/config/hypervisor/mod.rs
Expand Up @@ -336,7 +336,7 @@ pub struct DebugInfo {
/// exist. The dumped file(also called vmcore) can be processed with crash or gdb.
///
/// # WARNING:
/// Dump guests 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,
Expand Down Expand Up @@ -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
));
}
Expand Down Expand Up @@ -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(())
Expand Down Expand Up @@ -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(())
Expand Down
10 changes: 5 additions & 5 deletions src/libs/kata-types/src/config/hypervisor/qemu.rs
Expand Up @@ -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();
Expand Down Expand Up @@ -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"));
Expand Down

0 comments on commit 45e5780

Please sign in to comment.