mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 12:35:19 +00:00
ch-remote: Add support for vmm.ping
Signed-off-by: Shuaiyi Zhang <zhangsy28@lenovo.com>
This commit is contained in:
parent
ca6d338ffa
commit
0e09b537e3
@ -8,6 +8,7 @@ extern crate clap;
|
|||||||
|
|
||||||
use api_client::simple_api_command;
|
use api_client::simple_api_command;
|
||||||
use api_client::simple_api_command_with_fds;
|
use api_client::simple_api_command_with_fds;
|
||||||
|
use api_client::simple_api_full_command;
|
||||||
use api_client::Error as ApiClientError;
|
use api_client::Error as ApiClientError;
|
||||||
use clap::{Arg, ArgAction, ArgMatches, Command};
|
use clap::{Arg, ArgAction, ArgMatches, Command};
|
||||||
use option_parser::{ByteSized, ByteSizedParseError};
|
use option_parser::{ByteSized, ByteSizedParseError};
|
||||||
@ -338,6 +339,9 @@ fn do_command(matches: &ArgMatches) -> Result<(), Error> {
|
|||||||
Some("counters") => {
|
Some("counters") => {
|
||||||
simple_api_command(&mut socket, "GET", "counters", None).map_err(Error::ApiClient)
|
simple_api_command(&mut socket, "GET", "counters", None).map_err(Error::ApiClient)
|
||||||
}
|
}
|
||||||
|
Some("ping") => {
|
||||||
|
simple_api_full_command(&mut socket, "GET", "vmm.ping", None).map_err(Error::ApiClient)
|
||||||
|
}
|
||||||
Some("resize") => resize_api_command(
|
Some("resize") => resize_api_command(
|
||||||
&mut socket,
|
&mut socket,
|
||||||
matches
|
matches
|
||||||
@ -675,6 +679,9 @@ fn main() {
|
|||||||
Command::new("create")
|
Command::new("create")
|
||||||
.about("Create VM from a JSON configuration")
|
.about("Create VM from a JSON configuration")
|
||||||
.arg(Arg::new("path").index(1).default_value("-")),
|
.arg(Arg::new("path").index(1).default_value("-")),
|
||||||
|
)
|
||||||
|
.subcommand(
|
||||||
|
Command::new("ping").about("Ping the VMM to check for API server availability"),
|
||||||
);
|
);
|
||||||
|
|
||||||
let matches = app.get_matches();
|
let matches = app.get_matches();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user