mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-05 11:36:56 +00:00
libs/types: fixed spelling and grammer error
fixed spelling and grammer error in some files Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
This commit is contained in:
parent
2599a06a56
commit
45e5780e7c
@ -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
|
||||
}
|
||||
|
||||
@ -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),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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(())
|
||||
|
@ -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"));
|
||||
|
Loading…
Reference in New Issue
Block a user