mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: api: Add a VMM shutdown command
This shuts the current VM down, if any, and then exits the VMM process. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
228adebc32
commit
a95fa1c4e8
@@ -5,7 +5,7 @@
|
||||
|
||||
extern crate threadpool;
|
||||
|
||||
use crate::api::http_endpoint::{VmActionHandler, VmCreate, VmInfo};
|
||||
use crate::api::http_endpoint::{VmActionHandler, VmCreate, VmInfo, VmmShutdown};
|
||||
use crate::api::{ApiRequest, VmAction};
|
||||
use crate::{Error, Result};
|
||||
use micro_http::{HttpConnection, Request, Response, StatusCode, Version};
|
||||
@@ -60,6 +60,7 @@ lazy_static! {
|
||||
r.routes.insert(endpoint!("/vm.info"), Box::new(VmInfo {}));
|
||||
r.routes.insert(endpoint!("/vm.shutdown"), Box::new(VmActionHandler::new(VmAction::Shutdown)));
|
||||
r.routes.insert(endpoint!("/vm.reboot"), Box::new(VmActionHandler::new(VmAction::Reboot)));
|
||||
r.routes.insert(endpoint!("/vmm.shutdown"), Box::new(VmmShutdown {}));
|
||||
|
||||
r
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user