Creates the CLI definition of Cloud Hypervisor.
(default_vcpus: String, default_memory: String, default_rng: String)
| 455 | |
| 456 | /// Creates the CLI definition of Cloud Hypervisor. |
| 457 | fn create_app(default_vcpus: String, default_memory: String, default_rng: String) -> Command { |
| 458 | let groups = [ |
| 459 | ArgGroup::new("vm-config") |
| 460 | .multiple(true) |
| 461 | .requires("vm-payload"), |
| 462 | ArgGroup::new("vmm-config").multiple(true), |
| 463 | ArgGroup::new("logging").multiple(true), |
| 464 | ArgGroup::new("vm-payload").multiple(true), |
| 465 | ]; |
| 466 | |
| 467 | let args = get_cli_options_sorted(default_vcpus, default_memory, default_rng); |
| 468 | |
| 469 | Command::new("cloud-hypervisor") |
| 470 | // 'BUILD_VERSION' is set by the build script 'build.rs' at |
| 471 | // compile time |
| 472 | .author(env!("CARGO_PKG_AUTHORS")) |
| 473 | .about("Launch a cloud-hypervisor VMM.") |
| 474 | .arg_required_else_help(true) |
| 475 | .groups(groups) |
| 476 | .args(args) |
| 477 | } |
| 478 | |
| 479 | fn parse_api_socket(cmd_arguments: &ArgMatches) -> Result<(Option<String>, Option<RawFd>), Error> { |
| 480 | if let Some(socket_config) = cmd_arguments.get_one::<String>("api-socket") { |
no test coverage detected