mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 21:55:20 +00:00
vmm: config: Move --vsock syntax to VsockConfig
This means it can be reused with ch-remote. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
6e049e0da1
commit
f8501a3bd3
@ -195,10 +195,7 @@ fn create_app<'a, 'b>(
|
||||
.arg(
|
||||
Arg::with_name("vsock")
|
||||
.long("vsock")
|
||||
.help(
|
||||
"Virtio VSOCK parameters \
|
||||
\"cid=<context_id>,sock=<socket_path>,iommu=on|off,id=<device_id>\"",
|
||||
)
|
||||
.help(config::VsockConfig::SYNTAX)
|
||||
.takes_value(true)
|
||||
.number_of_values(1)
|
||||
.group("vm-config"),
|
||||
|
@ -1141,6 +1141,8 @@ pub struct VsockConfig {
|
||||
}
|
||||
|
||||
impl VsockConfig {
|
||||
pub const SYNTAX: &'static str = "Virtio VSOCK parameters \
|
||||
\"cid=<context_id>,sock=<socket_path>,iommu=on|off,id=<device_id>\"";
|
||||
pub fn parse(vsock: &str) -> Result<Self> {
|
||||
let mut parser = OptionParser::new();
|
||||
parser.add("sock").add("cid").add("iommu").add("id");
|
||||
|
Loading…
Reference in New Issue
Block a user