mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
vmm: Add mergeable=on|off option to --pmem flag
In order to let the user indicate if the persistent memory pages should be marked as mergeable or not, a new option is being introduced. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
e4e8062dda
commit
0f9afc3017
@ -171,7 +171,7 @@ fn main() {
|
||||
.long("pmem")
|
||||
.help(
|
||||
"Persistent memory parameters \"file=<backing_file_path>,\
|
||||
size=<persistent_memory_size>,iommu=on|off\"",
|
||||
size=<persistent_memory_size>,iommu=on|off,mergeable=on|off\"",
|
||||
)
|
||||
.takes_value(true)
|
||||
.min_values(1)
|
||||
|
@ -322,6 +322,9 @@ components:
|
||||
iommu:
|
||||
type: boolean
|
||||
default: false
|
||||
mergeable:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
ConsoleConfig:
|
||||
required:
|
||||
|
@ -455,6 +455,8 @@ pub struct PmemConfig {
|
||||
pub size: u64,
|
||||
#[serde(default)]
|
||||
pub iommu: bool,
|
||||
#[serde(default)]
|
||||
pub mergeable: bool,
|
||||
}
|
||||
|
||||
impl PmemConfig {
|
||||
@ -465,6 +467,7 @@ impl PmemConfig {
|
||||
let mut file_str: &str = "";
|
||||
let mut size_str: &str = "";
|
||||
let mut iommu_str: &str = "";
|
||||
let mut mergeable_str: &str = "";
|
||||
|
||||
for param in params_list.iter() {
|
||||
if param.starts_with("file=") {
|
||||
@ -473,6 +476,8 @@ impl PmemConfig {
|
||||
size_str = ¶m[5..];
|
||||
} else if param.starts_with("iommu=") {
|
||||
iommu_str = ¶m[6..];
|
||||
} else if param.starts_with("mergeable=") {
|
||||
mergeable_str = ¶m[10..];
|
||||
}
|
||||
}
|
||||
|
||||
@ -484,6 +489,7 @@ impl PmemConfig {
|
||||
file: PathBuf::from(file_str),
|
||||
size: parse_size(size_str)?,
|
||||
iommu: parse_on_off(iommu_str)?,
|
||||
mergeable: parse_on_off(mergeable_str)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user