mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: api: Add "power-button" API entry point
This will lead to the triggering of an ACPI button inside the guest in order to cleanly shutdown the guest. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -106,6 +106,9 @@ pub enum HttpError {
|
||||
|
||||
/// Error setting up migration sender
|
||||
VmSendMigration(ApiError),
|
||||
|
||||
/// Error activating power button
|
||||
VmPowerButton(ApiError),
|
||||
}
|
||||
|
||||
impl From<serde_json::Error> for HttpError {
|
||||
@@ -210,6 +213,7 @@ lazy_static! {
|
||||
r.routes.insert(endpoint!("/vm.delete"), Box::new(VmActionHandler::new(VmAction::Delete)));
|
||||
r.routes.insert(endpoint!("/vm.info"), Box::new(VmInfo {}));
|
||||
r.routes.insert(endpoint!("/vm.pause"), Box::new(VmActionHandler::new(VmAction::Pause)));
|
||||
r.routes.insert(endpoint!("/vm.power-button"), Box::new(VmActionHandler::new(VmAction::PowerButton)));
|
||||
r.routes.insert(endpoint!("/vm.reboot"), Box::new(VmActionHandler::new(VmAction::Reboot)));
|
||||
r.routes.insert(endpoint!("/vm.receive-migration"), Box::new(VmActionHandler::new(VmAction::ReceiveMigration(Arc::default()))));
|
||||
r.routes.insert(endpoint!("/vm.remove-device"), Box::new(VmActionHandler::new(VmAction::RemoveDevice(Arc::default()))));
|
||||
|
||||
Reference in New Issue
Block a user