mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-31 15:25:26 +00:00
Merge pull request #5116 from liubin/fix/5115-replace-tab-by-space
libs/kata-types: replace tabs by spaces in comments
This commit is contained in:
commit
5df6ff991d
@ -181,7 +181,7 @@ pub const KATA_ANNO_CFG_HYPERVISOR_FIRMWARE_HASH: &str =
|
|||||||
/// A sandbox annotation to specify cpu specific features.
|
/// A sandbox annotation to specify cpu specific features.
|
||||||
pub const KATA_ANNO_CFG_HYPERVISOR_CPU_FEATURES: &str =
|
pub const KATA_ANNO_CFG_HYPERVISOR_CPU_FEATURES: &str =
|
||||||
"io.katacontainers.config.hypervisor.cpu_features";
|
"io.katacontainers.config.hypervisor.cpu_features";
|
||||||
/// A sandbox annotation for passing the default vcpus assigned for a VM by the hypervisor.
|
/// A sandbox annotation for passing the default vCPUs assigned for a VM by the hypervisor.
|
||||||
pub const KATA_ANNO_CFG_HYPERVISOR_DEFAULT_VCPUS: &str =
|
pub const KATA_ANNO_CFG_HYPERVISOR_DEFAULT_VCPUS: &str =
|
||||||
"io.katacontainers.config.hypervisor.default_vcpus";
|
"io.katacontainers.config.hypervisor.default_vcpus";
|
||||||
/// A sandbox annotation that specifies the maximum number of vCPUs allocated for the VM by the hypervisor.
|
/// A sandbox annotation that specifies the maximum number of vCPUs allocated for the VM by the hypervisor.
|
||||||
@ -202,7 +202,7 @@ pub const KATA_ANNO_CFG_HYPERVISOR_IOMMU: &str = "io.katacontainers.config.hyper
|
|||||||
pub const KATA_ANNO_CFG_HYPERVISOR_IOMMU_PLATFORM: &str =
|
pub const KATA_ANNO_CFG_HYPERVISOR_IOMMU_PLATFORM: &str =
|
||||||
"io.katacontainers.config.hypervisor.enable_iommu_platform";
|
"io.katacontainers.config.hypervisor.enable_iommu_platform";
|
||||||
|
|
||||||
// Hypervisor Machine related annotations
|
// Hypervisor Machine related annotations
|
||||||
/// A sandbox annotation to specify the type of machine being emulated by the hypervisor.
|
/// A sandbox annotation to specify the type of machine being emulated by the hypervisor.
|
||||||
pub const KATA_ANNO_CFG_HYPERVISOR_MACHINE_TYPE: &str =
|
pub const KATA_ANNO_CFG_HYPERVISOR_MACHINE_TYPE: &str =
|
||||||
"io.katacontainers.config.hypervisor.machine_type";
|
"io.katacontainers.config.hypervisor.machine_type";
|
||||||
@ -260,7 +260,7 @@ pub const KATA_ANNO_CFG_HYPERVISOR_ENABLE_ROOTLESS_HYPERVISOR: &str =
|
|||||||
"io.katacontainers.config.hypervisor.rootless";
|
"io.katacontainers.config.hypervisor.rootless";
|
||||||
|
|
||||||
// Hypervisor Shared File System related annotations
|
// Hypervisor Shared File System related annotations
|
||||||
/// A sandbox annotation to specify the shared file system type, either virtio-9p or virtio-fs.
|
/// A sandbox annotation to specify the shared file system type, either inline-virtio-fs (default), virtio-9p, virtio-fs or virtio-fs-nydus.
|
||||||
pub const KATA_ANNO_CFG_HYPERVISOR_SHARED_FS: &str =
|
pub const KATA_ANNO_CFG_HYPERVISOR_SHARED_FS: &str =
|
||||||
"io.katacontainers.config.hypervisor.shared_fs";
|
"io.katacontainers.config.hypervisor.shared_fs";
|
||||||
/// A sandbox annotations to specify virtio-fs vhost-user daemon path.
|
/// A sandbox annotations to specify virtio-fs vhost-user daemon path.
|
||||||
@ -468,7 +468,7 @@ impl Annotation {
|
|||||||
if hv.security_info.is_annotation_enabled(key) {
|
if hv.security_info.is_annotation_enabled(key) {
|
||||||
match key.as_str() {
|
match key.as_str() {
|
||||||
// update hypervisor config
|
// update hypervisor config
|
||||||
// Hypervisor related annotations
|
// Hypervisor related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_PATH => {
|
KATA_ANNO_CFG_HYPERVISOR_PATH => {
|
||||||
hv.validate_hypervisor_path(value)?;
|
hv.validate_hypervisor_path(value)?;
|
||||||
hv.path = value.to_string();
|
hv.path = value.to_string();
|
||||||
@ -491,7 +491,7 @@ impl Annotation {
|
|||||||
return Err(bool_err);
|
return Err(bool_err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Hypervisor Block Device related annotations
|
// Hypervisor Block Device related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_BLOCK_DEV_DRIVER => {
|
KATA_ANNO_CFG_HYPERVISOR_BLOCK_DEV_DRIVER => {
|
||||||
hv.blockdev_info.block_device_driver = value.to_string();
|
hv.blockdev_info.block_device_driver = value.to_string();
|
||||||
}
|
}
|
||||||
@ -587,7 +587,7 @@ impl Annotation {
|
|||||||
hv.boot_info.validate_boot_path(value)?;
|
hv.boot_info.validate_boot_path(value)?;
|
||||||
hv.boot_info.firmware = value.to_string();
|
hv.boot_info.firmware = value.to_string();
|
||||||
}
|
}
|
||||||
// Hypervisor CPU related annotations
|
// Hypervisor CPU related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_CPU_FEATURES => {
|
KATA_ANNO_CFG_HYPERVISOR_CPU_FEATURES => {
|
||||||
hv.cpu_info.cpu_features = value.to_string();
|
hv.cpu_info.cpu_features = value.to_string();
|
||||||
}
|
}
|
||||||
@ -627,7 +627,7 @@ impl Annotation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Hypervisor Device related annotations
|
// Hypervisor Device related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_HOTPLUG_VFIO_ON_ROOT_BUS => {
|
KATA_ANNO_CFG_HYPERVISOR_HOTPLUG_VFIO_ON_ROOT_BUS => {
|
||||||
match self.get_value::<bool>(key) {
|
match self.get_value::<bool>(key) {
|
||||||
Ok(r) => {
|
Ok(r) => {
|
||||||
@ -662,7 +662,7 @@ impl Annotation {
|
|||||||
return Err(bool_err);
|
return Err(bool_err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Hypervisor Machine related annotations
|
// Hypervisor Machine related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_MACHINE_TYPE => {
|
KATA_ANNO_CFG_HYPERVISOR_MACHINE_TYPE => {
|
||||||
hv.machine_info.machine_type = value.to_string();
|
hv.machine_info.machine_type = value.to_string();
|
||||||
}
|
}
|
||||||
@ -673,7 +673,7 @@ impl Annotation {
|
|||||||
hv.machine_info.validate_entropy_source(value)?;
|
hv.machine_info.validate_entropy_source(value)?;
|
||||||
hv.machine_info.entropy_source = value.to_string();
|
hv.machine_info.entropy_source = value.to_string();
|
||||||
}
|
}
|
||||||
// Hypervisor Memory related annotations
|
// Hypervisor Memory related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_MEMORY => {
|
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_MEMORY => {
|
||||||
match byte_unit::Byte::from_str(value) {
|
match byte_unit::Byte::from_str(value) {
|
||||||
Ok(mem_bytes) => {
|
Ok(mem_bytes) => {
|
||||||
@ -762,7 +762,7 @@ impl Annotation {
|
|||||||
return Err(bool_err);
|
return Err(bool_err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Hypervisor Network related annotations
|
// Hypervisor Network related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_DISABLE_VHOST_NET => match self.get_value::<bool>(key)
|
KATA_ANNO_CFG_HYPERVISOR_DISABLE_VHOST_NET => match self.get_value::<bool>(key)
|
||||||
{
|
{
|
||||||
Ok(r) => {
|
Ok(r) => {
|
||||||
@ -792,7 +792,7 @@ impl Annotation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Hypervisor Security related annotations
|
// Hypervisor Security related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_GUEST_HOOK_PATH => {
|
KATA_ANNO_CFG_HYPERVISOR_GUEST_HOOK_PATH => {
|
||||||
hv.security_info.validate_path(value)?;
|
hv.security_info.validate_path(value)?;
|
||||||
hv.security_info.guest_hook_path = value.to_string();
|
hv.security_info.guest_hook_path = value.to_string();
|
||||||
@ -807,7 +807,7 @@ impl Annotation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Hypervisor Shared File System related annotations
|
// Hypervisor Shared File System related annotations
|
||||||
KATA_ANNO_CFG_HYPERVISOR_SHARED_FS => {
|
KATA_ANNO_CFG_HYPERVISOR_SHARED_FS => {
|
||||||
hv.shared_fs.shared_fs = self.get(key);
|
hv.shared_fs.shared_fs = self.get(key);
|
||||||
}
|
}
|
||||||
@ -855,7 +855,7 @@ impl Annotation {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match key.as_str() {
|
match key.as_str() {
|
||||||
//update agent config
|
// update agent config
|
||||||
KATA_ANNO_CFG_KERNEL_MODULES => {
|
KATA_ANNO_CFG_KERNEL_MODULES => {
|
||||||
let kernel_mod: Vec<String> =
|
let kernel_mod: Vec<String> =
|
||||||
value.to_string().split(';').map(str::to_string).collect();
|
value.to_string().split(';').map(str::to_string).collect();
|
||||||
@ -879,7 +879,7 @@ impl Annotation {
|
|||||||
return Err(u32_err);
|
return Err(u32_err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//update runtime config
|
// update runtime config
|
||||||
KATA_ANNO_CFG_RUNTIME_NAME => {
|
KATA_ANNO_CFG_RUNTIME_NAME => {
|
||||||
let runtime = vec!["virt-container", "linux-container", "wasm-container"];
|
let runtime = vec!["virt-container", "linux-container", "wasm-container"];
|
||||||
if runtime.contains(&value.as_str()) {
|
if runtime.contains(&value.as_str()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user