mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-02 11:35:46 +00:00
bin, vmm: Centralise the disk syntax
This will allow the syntax to be reused with cloud-hypervsor binary and ch-remote. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
ede288789a
commit
66da29d8dd
@ -122,13 +122,7 @@ fn create_app<'a, 'b>(
|
|||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("disk")
|
Arg::with_name("disk")
|
||||||
.long("disk")
|
.long("disk")
|
||||||
.help(
|
.help(config::DiskConfig::SYNTAX)
|
||||||
"Disk parameters \
|
|
||||||
\"path=<disk_image_path>,readonly=on|off,iommu=on|off,\
|
|
||||||
num_queues=<number_of_queues>,queue_size=<size_of_each_queue>,\
|
|
||||||
vhost_user=<vhost_user_enable>,socket=<vhost_user_socket_path>,\
|
|
||||||
wce=<true|false, default true>\"",
|
|
||||||
)
|
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
.group("vm-config"),
|
.group("vm-config"),
|
||||||
|
@ -374,6 +374,11 @@ fn default_diskconfig_poll_queue() -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DiskConfig {
|
impl DiskConfig {
|
||||||
|
pub const SYNTAX: &'static str = "Disk parameters \
|
||||||
|
\"path=<disk_image_path>,readonly=on|off,iommu=on|off,num_queues=<number_of_queues>,\
|
||||||
|
queue_size=<size_of_each_queue>,vhost_user=<vhost_user_enable>,\
|
||||||
|
socket=<vhost_user_socket_path>,wce=<true|false, default true>\"";
|
||||||
|
|
||||||
pub fn parse(disk: &str) -> Result<Self> {
|
pub fn parse(disk: &str) -> Result<Self> {
|
||||||
// Split the parameters based on the comma delimiter
|
// Split the parameters based on the comma delimiter
|
||||||
let params_list: Vec<&str> = disk.split(',').collect();
|
let params_list: Vec<&str> = disk.split(',').collect();
|
||||||
|
Loading…
Reference in New Issue
Block a user