mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-05 03:21:13 +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")
|
.long("pmem")
|
||||||
.help(
|
.help(
|
||||||
"Persistent memory parameters \"file=<backing_file_path>,\
|
"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)
|
.takes_value(true)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
|
@ -322,6 +322,9 @@ components:
|
|||||||
iommu:
|
iommu:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
mergeable:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
ConsoleConfig:
|
ConsoleConfig:
|
||||||
required:
|
required:
|
||||||
|
@ -455,6 +455,8 @@ pub struct PmemConfig {
|
|||||||
pub size: u64,
|
pub size: u64,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub iommu: bool,
|
pub iommu: bool,
|
||||||
|
#[serde(default)]
|
||||||
|
pub mergeable: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PmemConfig {
|
impl PmemConfig {
|
||||||
@ -465,6 +467,7 @@ impl PmemConfig {
|
|||||||
let mut file_str: &str = "";
|
let mut file_str: &str = "";
|
||||||
let mut size_str: &str = "";
|
let mut size_str: &str = "";
|
||||||
let mut iommu_str: &str = "";
|
let mut iommu_str: &str = "";
|
||||||
|
let mut mergeable_str: &str = "";
|
||||||
|
|
||||||
for param in params_list.iter() {
|
for param in params_list.iter() {
|
||||||
if param.starts_with("file=") {
|
if param.starts_with("file=") {
|
||||||
@ -473,6 +476,8 @@ impl PmemConfig {
|
|||||||
size_str = ¶m[5..];
|
size_str = ¶m[5..];
|
||||||
} else if param.starts_with("iommu=") {
|
} else if param.starts_with("iommu=") {
|
||||||
iommu_str = ¶m[6..];
|
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),
|
file: PathBuf::from(file_str),
|
||||||
size: parse_size(size_str)?,
|
size: parse_size(size_str)?,
|
||||||
iommu: parse_on_off(iommu_str)?,
|
iommu: parse_on_off(iommu_str)?,
|
||||||
|
mergeable: parse_on_off(mergeable_str)?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user