pub enum AdminRequest {
PowerFullyOn {
responder: AdminPowerFullyOnResponder,
},
Shutdown {
options: ShutdownOptions,
responder: AdminShutdownResponder,
},
Reboot {
reason: RebootReason,
responder: AdminRebootResponder,
},
PerformReboot {
options: RebootOptions,
responder: AdminPerformRebootResponder,
},
RebootToBootloader {
responder: AdminRebootToBootloaderResponder,
},
RebootToRecovery {
responder: AdminRebootToRecoveryResponder,
},
Poweroff {
responder: AdminPoweroffResponder,
},
Mexec {
kernel_zbi: Vmo,
data_zbi: Vmo,
responder: AdminMexecResponder,
},
SuspendToRam {
responder: AdminSuspendToRamResponder,
},
}
Expand description
Provides methods to request that the system be transitioned into a supported power state.
Note (see https://fxbug.dev/42136295):
These methods do not return until after the state transition has been completed. In most cases
(e.g. Reboot), a successful transition means that the caller does not actually observe the
completion because the system will be rebooted before the call is completed. The implication is
that using a synchronous FIDL client with these methods will result in a blocked thread for the
duration of the call, or even for the remainder of the component’s life (in the case of Reboot).
Therefore, if a synchronous FIDL client is to be used with this protocol then care should be
taken to avoid handling any shutdown-induced callbacks on the same thread that was used to
initiate the transition. Example callbacks include [fuchsia.process.lifecycle/Lifecycle.Stop
]
and [fuchsia.hardware.power.statecontrol/RebootMethodsWatcher.OnReboot
].
Alternatively, the caller could choose to use an asynchronous FIDL client with this protocol to
avoid blocking their calling thread.
Variants§
PowerFullyOn
Asks the device to enter a fully on state.
Fields
responder: AdminPowerFullyOnResponder
Shutdown
Asks the device to enter the state specified by options.action
.
Arguments:
- options: The options with which to perform this request.
ZX_ERR_INVALID_ARGS
is returned ifaction
is absent.reasons
may be omitted, but adding a new enum value instead is strongly encouraged.
Reboot
Asks the device to reboot.
Replaced by PerformReboot
.
PerformReboot
Asks the device to reboot.
Arguments:
- options: The options with which to perform this requests.
ZX_ERR_INVALID_ARGS
is returned if the options are malformed (i.e.reasons
is absent or empty).
§Deprecation
Use Shutdown, which allows callers to specify the intended action and reasons for the action.
RebootToBootloader
Asks the device to reboot into the bootloader.
§Deprecation
Use Shutdown, which allows callers to specify reasons why they are requesting a reboot to bootloader.
Fields
responder: AdminRebootToBootloaderResponder
RebootToRecovery
Asks the device to reboot into the recovery partition.
§Deprecation
Use Shutdown, which allows callers to specify reasons why they are requesting a reboot to recovery.
Fields
responder: AdminRebootToRecoveryResponder
Poweroff
Asks all devices to enter a powered off state.
§Deprecation
Use Shutdown, which allows callers to specify reasons why they are requesting a poweroff.
Fields
responder: AdminPoweroffResponder
Mexec
Performs a kernel mexec.
It is expected that the ZBI items specified by
zx_system_mexec_payload_get()
have not yet been appended to the
provided data ZBI.
SuspendToRam
Asks the device to enter the suspend to RAM (S3) power state. Currently only supported on x64. If a system state transition is already in progress then ZX_ERR_ALREADY_EXISTS is returned. If the device fails to reach the suspend power state then ZX_ERR_INTERNAL is returned. If the device successfully suspends, ZX_OK is returned when the device resumes.
Fields
responder: AdminSuspendToRamResponder
Implementations§
Source§impl AdminRequest
impl AdminRequest
pub fn into_power_fully_on(self) -> Option<AdminPowerFullyOnResponder>
pub fn into_shutdown(self) -> Option<(ShutdownOptions, AdminShutdownResponder)>
pub fn into_reboot(self) -> Option<(RebootReason, AdminRebootResponder)>
pub fn into_perform_reboot( self, ) -> Option<(RebootOptions, AdminPerformRebootResponder)>
pub fn into_reboot_to_bootloader( self, ) -> Option<AdminRebootToBootloaderResponder>
pub fn into_reboot_to_recovery(self) -> Option<AdminRebootToRecoveryResponder>
pub fn into_poweroff(self) -> Option<AdminPoweroffResponder>
pub fn into_mexec(self) -> Option<(Vmo, Vmo, AdminMexecResponder)>
pub fn into_suspend_to_ram(self) -> Option<AdminSuspendToRamResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL