mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-01 02:55:45 +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(
|
||||||
Arg::with_name("pmem")
|
Arg::with_name("pmem")
|
||||||
.long("pmem")
|
.long("pmem")
|
||||||
.help(
|
.help(config::PmemConfig::SYNTAX)
|
||||||
"Persistent memory parameters \
|
|
||||||
\"file=<backing_file_path>,size=<persistent_memory_size>,iommu=on|off,\
|
|
||||||
mergeable=on|off,discard_writes=on|off,\"",
|
|
||||||
)
|
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
.group("vm-config"),
|
.group("vm-config"),
|
||||||
|
@ -776,6 +776,9 @@ pub struct PmemConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl 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> {
|
pub fn parse(pmem: &str) -> Result<Self> {
|
||||||
// Split the parameters based on the comma delimiter
|
// Split the parameters based on the comma delimiter
|
||||||
let params_list: Vec<&str> = pmem.split(',').collect();
|
let params_list: Vec<&str> = pmem.split(',').collect();
|
||||||
|
Loading…
Reference in New Issue
Block a user