diff --git a/src/libs/kata-types/src/annotations/mod.rs b/src/libs/kata-types/src/annotations/mod.rs index cb29fd9b1e..188d20a06e 100644 --- a/src/libs/kata-types/src/annotations/mod.rs +++ b/src/libs/kata-types/src/annotations/mod.rs @@ -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::(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::(key) { Ok(r) => { diff --git a/src/libs/kata-types/src/config/hypervisor/mod.rs b/src/libs/kata-types/src/config/hypervisor/mod.rs index ed9312f93f..cef5e1d34f 100644 --- a/src/libs/kata-types/src/config/hypervisor/mod.rs +++ b/src/libs/kata-types/src/config/hypervisor/mod.rs @@ -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 diff --git a/src/libs/kata-types/tests/test_config.rs b/src/libs/kata-types/tests/test_config.rs index d350df724b..434b603265 100644 --- a/src/libs/kata-types/tests/test_config.rs +++ b/src/libs/kata-types/tests/test_config.rs @@ -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" diff --git a/src/libs/kata-types/tests/texture/configuration-anno-0.toml b/src/libs/kata-types/tests/texture/configuration-anno-0.toml index 7e997e79af..5b585b6eaf 100644 --- a/src/libs/kata-types/tests/texture/configuration-anno-0.toml +++ b/src/libs/kata-types/tests/texture/configuration-anno-0.toml @@ -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 diff --git a/src/libs/kata-types/tests/texture/configuration-anno-1.toml b/src/libs/kata-types/tests/texture/configuration-anno-1.toml index 1ca9f9ae73..ffeafe5375 100644 --- a/src/libs/kata-types/tests/texture/configuration-anno-1.toml +++ b/src/libs/kata-types/tests/texture/configuration-anno-1.toml @@ -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 diff --git a/src/runtime-rs/tests/texture/configuration-qemu.toml b/src/runtime-rs/tests/texture/configuration-qemu.toml index b8d876f89e..05bde09bd4 100644 --- a/src/runtime-rs/tests/texture/configuration-qemu.toml +++ b/src/runtime-rs/tests/texture/configuration-qemu.toml @@ -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