From 1708561c7417f4c7326de784a70b69d148a33671 Mon Sep 17 00:00:00 2001 From: Yi Wang Date: Mon, 18 Dec 2023 11:18:46 +0800 Subject: [PATCH] ch-remote: add support for nmi Adding the wrapping layer to be able to trigger NMI for the guest from the ch-remote tool. Signed-off-by: Yi Wang --- src/bin/ch-remote.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/ch-remote.rs b/src/bin/ch-remote.rs index d2a2baa81..1d4e2a4d8 100644 --- a/src/bin/ch-remote.rs +++ b/src/bin/ch-remote.rs @@ -297,6 +297,7 @@ fn rest_api_do_command(matches: &ArgMatches, socket: &mut UnixStream) -> ApiResu Some("shutdown") => { simple_api_command(socket, "PUT", "shutdown", None).map_err(Error::HttpApiClient) } + Some("nmi") => simple_api_command(socket, "PUT", "nmi", None).map_err(Error::HttpApiClient), Some("resize") => { let resize = resize_config( matches @@ -1089,7 +1090,8 @@ fn main() { .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("shutdown-vmm").about("Shutdown the VMM")); + .subcommand(Command::new("shutdown-vmm").about("Shutdown the VMM")) + .subcommand(Command::new("nmi").about("Trigger NMI")); let matches = app.get_matches();