ch-remote: Add support for vmm.shutdown

Signed-off-by: Shuaiyi Zhang <zhangsy28@lenovo.com>
This commit is contained in:
Shuaiyi Zhang 2022-12-06 10:07:17 +08:00 committed by Bo Chen
parent 00becda899
commit 389264351e

View File

@ -342,6 +342,8 @@ fn do_command(matches: &ArgMatches) -> Result<(), Error> {
Some("ping") => {
simple_api_full_command(&mut socket, "GET", "vmm.ping", None).map_err(Error::ApiClient)
}
Some("shutdown-vmm") => simple_api_full_command(&mut socket, "PUT", "vmm.shutdown", None)
.map_err(Error::ApiClient),
Some("resize") => resize_api_command(
&mut socket,
matches
@ -680,9 +682,8 @@ fn main() {
.about("Create VM from a JSON configuration")
.arg(Arg::new("path").index(1).default_value("-")),
)
.subcommand(
Command::new("ping").about("Ping the VMM to check for API server availability"),
);
.subcommand(Command::new("ping").about("Ping the VMM to check for API server availability"))
.subcommand(Command::new("shutdown-vmm").about("Shutdown the VMM"));
let matches = app.get_matches();