diff --git a/src/bin/ch-remote.rs b/src/bin/ch-remote.rs index 38964b455..f964888e2 100644 --- a/src/bin/ch-remote.rs +++ b/src/bin/ch-remote.rs @@ -267,10 +267,11 @@ fn main() { .subcommand( SubCommand::with_name("add-device") .about("Add VFIO device") - .arg(Arg::with_name("device_config").index(1).help( - "Direct device assignment parameters \ - \"path=,iommu=on|off,id=\"", - )), + .arg( + Arg::with_name("device_config") + .index(1) + .help(vmm::config::DeviceConfig::SYNTAX), + ), ) .subcommand( SubCommand::with_name("remove-device") diff --git a/src/main.rs b/src/main.rs index 2d96374f9..502711b93 100755 --- a/src/main.rs +++ b/src/main.rs @@ -198,10 +198,7 @@ fn create_app<'a, 'b>( .arg( Arg::with_name("device") .long("device") - .help( - "Direct device assignment parameters \ - \"path=,iommu=on|off,id=\"", - ) + .help(config::DeviceConfig::SYNTAX) .takes_value(true) .min_values(1) .group("vm-config"), diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 5613865f8..207e441ad 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -904,6 +904,8 @@ pub struct DeviceConfig { } impl DeviceConfig { + pub const SYNTAX: &'static str = + "Direct device assignment parameters \"path=,iommu=on|off,id=\""; pub fn parse(device: &str) -> Result { // Split the parameters based on the comma delimiter let params_list: Vec<&str> = device.split(',').collect();