guest_power_state_current()

Return the current power state of the guest system

Synopsis:

#include <qvm/guest.h>
int guest_power_state_current(struct guest_system *gsp,
                              enum guest_power_state_cmd cmd,
                              unsigned base,
                              unsigned nresult,
                              uint64_t *result)

Arguments:

gsp
A pointer to the guest system.
cmd
GPSC_WAIT: waiting bitset; GPSC_OFF: off bitset; GPSC_WAIT|GPSC_OFF, the waiting bitset ORed with the off bitset.
base
The starting index of an array with the resulting uint64_t values (currently always 0).
nresult
The number of entries provided in the result array.
result
A pointer to an array where the power state information is to be stored.

Library:

Provided by qvm; no external library is required.

Description:

To use this function you must have called guest_power_state_notify_create() to create a structure to hold the guest's power state information, and guest_power_state_notify_register() to register it.

Returns:

If successful, the number of result elements filled in; otherwise, a negative errno value.