1
0
mirror of https://github.com/cloud-hypervisor/cloud-hypervisor.git synced 2025-03-07 17:26:14 +00:00

ch-remote: fixed ShutdownVmm and Shutdown commands

Fixed `ShutdownVmm` and `Shutdown` commands to call the correct API
endpoint.

Signed-off-by: Omer Faruk Bayram <omer.faruk@sartura.hr>
This commit is contained in:
Omer Faruk Bayram 2023-03-30 13:22:02 +03:00 committed by Bo Chen
parent d09af361bc
commit ff27b00f5a

@ -329,7 +329,8 @@ fn do_command(toplevel: &TopLevel) -> Result<(), Error> {
simple_api_command(&mut socket, "PUT", "delete", None).map_err(Error::ApiClient) simple_api_command(&mut socket, "PUT", "delete", None).map_err(Error::ApiClient)
} }
SubCommandEnum::ShutdownVmm(_) => { SubCommandEnum::ShutdownVmm(_) => {
simple_api_command(&mut socket, "PUT", "shutdown-vmm", None).map_err(Error::ApiClient) simple_api_full_command(&mut socket, "PUT", "vmm.shutdown", None)
.map_err(Error::ApiClient)
} }
SubCommandEnum::Resume(_) => { SubCommandEnum::Resume(_) => {
simple_api_command(&mut socket, "PUT", "resume", None).map_err(Error::ApiClient) simple_api_command(&mut socket, "PUT", "resume", None).map_err(Error::ApiClient)
@ -353,8 +354,7 @@ fn do_command(toplevel: &TopLevel) -> Result<(), Error> {
simple_api_full_command(&mut socket, "GET", "vmm.ping", None).map_err(Error::ApiClient) simple_api_full_command(&mut socket, "GET", "vmm.ping", None).map_err(Error::ApiClient)
} }
SubCommandEnum::Shutdown(_) => { SubCommandEnum::Shutdown(_) => {
simple_api_full_command(&mut socket, "PUT", "vmm.shutdown", None) simple_api_command(&mut socket, "PUT", "shutdown", None).map_err(Error::ApiClient)
.map_err(Error::ApiClient)
} }
SubCommandEnum::Resize(ref config) => { SubCommandEnum::Resize(ref config) => {
resize_api_command(&mut socket, config.cpus, &config.memory, &config.balloon) resize_api_command(&mut socket, config.cpus, &config.memory, &config.balloon)