diff --git a/docs/memory.md b/docs/memory.md index dcae83ab7..ad7a57f2b 100644 --- a/docs/memory.md +++ b/docs/memory.md @@ -207,7 +207,6 @@ describing how every memory region is backed and exposed to the guest. struct MemoryZoneConfig { id: String, size: u64, - file: Option, shared: bool, hugepages: bool, hugepage_size: Option, @@ -219,7 +218,7 @@ struct MemoryZoneConfig { ``` ``` ---memory-zone User defined memory zone parameters "size=,file=,shared=on|off,hugepages=on|off,hugepage_size=,host_numa_node=,id=,hotplug_size=,hotplugged_size=,prefault=on|off" +--memory-zone User defined memory zone parameters "size=,shared=on|off,hugepages=on|off,hugepage_size=,host_numa_node=,id=,hotplug_size=,hotplugged_size=,prefault=on|off" ``` This parameter expects one or more occurences, allowing for a list of memory @@ -264,30 +263,6 @@ _Example_ --memory-zone id=mem0,size=1G ``` -### `file` - -Path to the file backing the memory zone. This can be either a file or a -directory. In case of a file, it will be opened and used as the backing file -for the `mmap(2)` operation. In case of a directory, a temporary file with no -hard link on the filesystem will be created. This file will be used as the -backing file for the `mmap(2)` operation. - -This option can be particularly useful when trying to back a part of the guest -RAM with a well known file. In the context of the snapshot/restore feature, and -if the provided path is a file, the snapshot operation will not perform any -copy of the guest RAM content for this specific memory zone since the user has -access to it and it would duplicate data already stored on the current -filesystem. - -Value is a string. - -_Example_ - -``` ---memory size=0 ---memory-zone id=mem0,size=1G,file=/foo/bar -``` - ### `shared` Specifies if the memory zone must be `mmap(2)` with `MAP_SHARED` flag. diff --git a/src/main.rs b/src/main.rs index 4a57549b3..4055addaf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -177,7 +177,7 @@ fn create_app(default_vcpus: String, default_memory: String, default_rng: String .long("memory-zone") .help( "User defined memory zone parameters \ - \"size=,file=,\ + \"size=,\ shared=on|off,\ hugepages=on|off,hugepage_size=,\ host_numa_node=,\ diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index dee8bdbf0..962e8c1c6 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -668,8 +668,6 @@ components: type: integer format: int64 default: 512 MB - file: - type: string mergeable: type: boolean default: false diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 14b654e57..7f81531c2 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -2015,6 +2015,10 @@ impl VmConfig { if let Some(zones) = &self.memory.zones { for zone in zones.iter() { + if zone.file.is_some() { + warn!("MemoryZoneConfig::file is deprecated and will be removed in future release (#4837)"); + } + let id = zone.id.clone(); Self::validate_identifier(&mut id_list, &Some(id))?; }