mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Implement the power button method for AArch64
This commit implements the power button method for AArch64 using the PL061 GPIO controller. Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
@@ -2038,6 +2038,7 @@ impl Vm {
|
||||
.map_err(Error::ActivateVirtioDevices)
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub fn power_button(&self) -> Result<()> {
|
||||
#[cfg(feature = "acpi")]
|
||||
return self
|
||||
@@ -2049,6 +2050,15 @@ impl Vm {
|
||||
#[cfg(not(feature = "acpi"))]
|
||||
Err(Error::PowerButtonNotSupported)
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub fn power_button(&self) -> Result<()> {
|
||||
self.device_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.notify_power_button()
|
||||
.map_err(Error::PowerButton)
|
||||
}
|
||||
}
|
||||
|
||||
impl Pausable for Vm {
|
||||
|
||||
Reference in New Issue
Block a user