From 389264351ec9c06d9b6e4a19171530460c079b8c Mon Sep 17 00:00:00 2001 From: Shuaiyi Zhang Date: Tue, 6 Dec 2022 10:07:17 +0800 Subject: [PATCH] ch-remote: Add support for vmm.shutdown Signed-off-by: Shuaiyi Zhang --- src/bin/ch-remote.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/ch-remote.rs b/src/bin/ch-remote.rs index 4c8ddd3d9..2c83e7ba0 100644 --- a/src/bin/ch-remote.rs +++ b/src/bin/ch-remote.rs @@ -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();