mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-30 23:06:27 +00:00
Merge pull request #10762 from teawater/remove_enable_swap
libs/kata-types: Remove config enable_swap
This commit is contained in:
commit
944eb2cf3f
@ -227,9 +227,6 @@ pub const KATA_ANNO_CFG_HYPERVISOR_FILE_BACKED_MEM_ROOT_DIR: &str =
|
||||
/// A sandbox annotation that is used to enable/disable virtio-mem.
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_VIRTIO_MEM: &str =
|
||||
"io.katacontainers.config.hypervisor.enable_virtio_mem";
|
||||
/// A sandbox annotation to enable swap of vm memory.
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_ENABLE_SWAP: &str =
|
||||
"io.katacontainers.config.hypervisor.enable_swap";
|
||||
/// A sandbox annotation to enable swap in the guest.
|
||||
pub const KATA_ANNO_CFG_HYPERVISOR_ENABLE_GUEST_SWAP: &str =
|
||||
"io.katacontainers.config.hypervisor.enable_guest_swap";
|
||||
@ -786,14 +783,6 @@ impl Annotation {
|
||||
return Err(bool_err);
|
||||
}
|
||||
},
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_SWAP => match self.get_value::<bool>(key) {
|
||||
Ok(r) => {
|
||||
hv.memory_info.enable_swap = r.unwrap_or_default();
|
||||
}
|
||||
Err(_e) => {
|
||||
return Err(bool_err);
|
||||
}
|
||||
},
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_GUEST_SWAP => match self.get_value::<bool>(key)
|
||||
{
|
||||
Ok(r) => {
|
||||
|
@ -708,12 +708,6 @@ pub struct MemoryInfo {
|
||||
#[serde(default)]
|
||||
pub enable_virtio_mem: bool,
|
||||
|
||||
/// Enable swap of vm memory. Default false.
|
||||
///
|
||||
/// The behaviour is undefined if mem_prealloc is also set to true
|
||||
#[serde(default)]
|
||||
pub enable_swap: bool,
|
||||
|
||||
/// Enable swap in the guest. Default false.
|
||||
///
|
||||
/// When enable_guest_swap is enabled, insert a raw file to the guest as the swap device if the
|
||||
|
@ -11,7 +11,7 @@ mod tests {
|
||||
KATA_ANNO_CFG_HYPERVISOR_BLOCK_DEV_DRIVER, KATA_ANNO_CFG_HYPERVISOR_CTLPATH,
|
||||
KATA_ANNO_CFG_HYPERVISOR_DEFAULT_MEMORY, KATA_ANNO_CFG_HYPERVISOR_DEFAULT_VCPUS,
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_GUEST_SWAP, KATA_ANNO_CFG_HYPERVISOR_ENABLE_HUGEPAGES,
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_IO_THREADS, KATA_ANNO_CFG_HYPERVISOR_ENABLE_SWAP,
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_IO_THREADS
|
||||
KATA_ANNO_CFG_HYPERVISOR_FILE_BACKED_MEM_ROOT_DIR,
|
||||
KATA_ANNO_CFG_HYPERVISOR_GUEST_HOOK_PATH, KATA_ANNO_CFG_HYPERVISOR_JAILER_PATH,
|
||||
KATA_ANNO_CFG_HYPERVISOR_KERNEL_PATH, KATA_ANNO_CFG_HYPERVISOR_MEMORY_PREALLOC,
|
||||
@ -129,10 +129,6 @@ mod tests {
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_IO_THREADS.to_string(),
|
||||
"false".to_string(),
|
||||
);
|
||||
anno_hash.insert(
|
||||
KATA_ANNO_CFG_HYPERVISOR_ENABLE_SWAP.to_string(),
|
||||
"false".to_string(),
|
||||
);
|
||||
anno_hash.insert(
|
||||
KATA_ANNO_CFG_HYPERVISOR_FILE_BACKED_MEM_ROOT_DIR.to_string(),
|
||||
"./test_file_backend_mem_root".to_string(),
|
||||
@ -201,7 +197,6 @@ mod tests {
|
||||
assert_eq!(hv.memory_info.default_memory, 100);
|
||||
assert!(!hv.enable_iothreads);
|
||||
assert!(!hv.enable_iothreads);
|
||||
assert!(!hv.memory_info.enable_swap);
|
||||
assert_eq!(
|
||||
hv.memory_info.file_mem_backend,
|
||||
"./test_file_backend_mem_root"
|
||||
|
@ -19,7 +19,7 @@ default_maxvcpus = 64
|
||||
machine_type = "q35"
|
||||
confidential_guest = true
|
||||
rootless = true
|
||||
enable_annotations = ["shared_fs","path", "ctlpath","jailer_path","enable_iothreads","default_memory","memory_slots","enable_mem_prealloc","enable_hugepages","file_mem_backend","enable_virtio_mem","enable_swap","enable_guest_swap","default_vcpus","virtio_fs_extra_args","block_device_driver","vhost_user_store_path","kernel","guest_hook_path","block_device_cache_noflush","virtio_fs_daemon"]
|
||||
enable_annotations = ["shared_fs","path", "ctlpath","jailer_path","enable_iothreads","default_memory","memory_slots","enable_mem_prealloc","enable_hugepages","file_mem_backend","enable_virtio_mem","enable_guest_swap","default_vcpus","virtio_fs_extra_args","block_device_driver","vhost_user_store_path","kernel","guest_hook_path","block_device_cache_noflush","virtio_fs_daemon"]
|
||||
machine_accelerators="noapic"
|
||||
default_bridges = 2
|
||||
default_memory = 128
|
||||
@ -46,7 +46,6 @@ enable_iommu = true
|
||||
enable_iommu_platform = true
|
||||
file_mem_backend = "/dev/shm"
|
||||
valid_file_mem_backends = ["/dev/shm","/dev/snd","./test_file_backend_mem_root"]
|
||||
enable_swap = true
|
||||
pflashes = ["/proc/mounts"]
|
||||
enable_debug = true
|
||||
msize_9p = 16384
|
||||
|
@ -45,7 +45,6 @@ enable_iommu = true
|
||||
enable_iommu_platform = true
|
||||
file_mem_backend = "/dev/shm"
|
||||
valid_file_mem_backends = ["/dev/shm"]
|
||||
enable_swap = true
|
||||
pflashes = ["/proc/mounts"]
|
||||
enable_debug = true
|
||||
msize_9p = 16384
|
||||
|
@ -19,7 +19,7 @@ default_maxvcpus = 64
|
||||
machine_type = "q35"
|
||||
confidential_guest = true
|
||||
rootless = true
|
||||
enable_annotations = ["shared_fs","path", "ctlpath","jailer_path","enable_iothreads","default_memory","memory_slots","enable_mem_prealloc","enable_hugepages","file_mem_backend","enable_virtio_mem","enable_swap","enable_guest_swap","default_vcpus","virtio_fs_extra_args","block_device_driver","vhost_user_store_path","kernel","guest_hook_path","block_device_cache_noflush","virtio_fs_daemon"]
|
||||
enable_annotations = ["shared_fs","path", "ctlpath","jailer_path","enable_iothreads","default_memory","memory_slots","enable_mem_prealloc","enable_hugepages","file_mem_backend","enable_virtio_mem","enable_guest_swap","default_vcpus","virtio_fs_extra_args","block_device_driver","vhost_user_store_path","kernel","guest_hook_path","block_device_cache_noflush","virtio_fs_daemon"]
|
||||
machine_accelerators="noapic"
|
||||
default_bridges = 2
|
||||
default_memory = 128
|
||||
@ -46,7 +46,6 @@ enable_iommu = true
|
||||
enable_iommu_platform = true
|
||||
file_mem_backend = "/dev/shm"
|
||||
valid_file_mem_backends = ["/dev/shm","/dev/snd","./test_file_backend_mem_root"]
|
||||
enable_swap = true
|
||||
pflashes = ["/proc/mounts"]
|
||||
enable_debug = true
|
||||
msize_9p = 16384
|
||||
|
Loading…
Reference in New Issue
Block a user