mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
bin, vmm: Centralise the pmem syntax
This will allow the syntax to be reused with cloud-hypervisor binary and ch-remote. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
61e34331c2
commit
a7296bbb52
@ -165,11 +165,7 @@ fn create_app<'a, 'b>(
|
||||
.arg(
|
||||
Arg::with_name("pmem")
|
||||
.long("pmem")
|
||||
.help(
|
||||
"Persistent memory parameters \
|
||||
\"file=<backing_file_path>,size=<persistent_memory_size>,iommu=on|off,\
|
||||
mergeable=on|off,discard_writes=on|off,\"",
|
||||
)
|
||||
.help(config::PmemConfig::SYNTAX)
|
||||
.takes_value(true)
|
||||
.min_values(1)
|
||||
.group("vm-config"),
|
||||
|
@ -776,6 +776,9 @@ pub struct PmemConfig {
|
||||
}
|
||||
|
||||
impl PmemConfig {
|
||||
pub const SYNTAX: &'static str = "Persistent memory parameters \
|
||||
\"file=<backing_file_path>,size=<persistent_memory_size>,iommu=on|off,\
|
||||
mergeable=on|off,discard_writes=on|off,\"";
|
||||
pub fn parse(pmem: &str) -> Result<Self> {
|
||||
// Split the parameters based on the comma delimiter
|
||||
let params_list: Vec<&str> = pmem.split(',').collect();
|
||||
|
Loading…
Reference in New Issue
Block a user