diff --git a/src/main.rs b/src/main.rs index 89b16bed8..42ec38477 100755 --- a/src/main.rs +++ b/src/main.rs @@ -122,13 +122,7 @@ fn create_app<'a, 'b>( .arg( Arg::with_name("disk") .long("disk") - .help( - "Disk parameters \ - \"path=,readonly=on|off,iommu=on|off,\ - num_queues=,queue_size=,\ - vhost_user=,socket=,\ - wce=\"", - ) + .help(config::DiskConfig::SYNTAX) .takes_value(true) .min_values(1) .group("vm-config"), diff --git a/vmm/src/config.rs b/vmm/src/config.rs index e09c4033c..3a88024b5 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -374,6 +374,11 @@ fn default_diskconfig_poll_queue() -> bool { } impl DiskConfig { + pub const SYNTAX: &'static str = "Disk parameters \ + \"path=,readonly=on|off,iommu=on|off,num_queues=,\ + queue_size=,vhost_user=,\ + socket=,wce=\""; + pub fn parse(disk: &str) -> Result { // Split the parameters based on the comma delimiter let params_list: Vec<&str> = disk.split(',').collect();