diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-02-23 13:45:19 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-24 13:36:02 -0600 |
commit | 95b363b5c643d8ad81c5377726e753b84c909037 (patch) | |
tree | 59cf3cd9d5f38ef3027cf58669ea9110b3fd7a80 /sysemu.h | |
parent | 8283c4f565a26b3415961c481d980310c83dd2b4 (diff) | |
download | qemu-95b363b5c643d8ad81c5377726e753b84c909037.tar.gz qemu-95b363b5c643d8ad81c5377726e753b84c909037.tar.bz2 qemu-95b363b5c643d8ad81c5377726e753b84c909037.zip |
suspend: add infrastructure
This patch adds some infrastructure to handle suspend and resume to
qemu. First there are two functions to switch state and second there
is a suspend notifier:
* qemu_system_suspend_request is supposed to be called when the
guest asks for being be suspended, for example via ACPI.
* qemu_system_wakeup_request is supposed to be called on events
which should wake up the guest.
* qemu_register_suspend_notifier can be used to register a notifier
which will be called when the guest is suspended. Machine types
and device models can hook in there to modify state if needed.
* qemu_register_wakeup_notifier can be used to register a notifier
which will be called when the guest is woken up. Machine types
and device models can hook in there to modify state if needed.
* qemu_system_wakeup_enable can be used to enable/disable wakeup
events.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'sysemu.h')
-rw-r--r-- | sysemu.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -38,7 +38,16 @@ void vm_start(void); void vm_stop(RunState state); void vm_stop_force_state(RunState state); +typedef enum WakeupReason { + QEMU_WAKEUP_REASON_OTHER = 0, +} WakeupReason; + void qemu_system_reset_request(void); +void qemu_system_suspend_request(void); +void qemu_register_suspend_notifier(Notifier *notifier); +void qemu_system_wakeup_request(WakeupReason reason); +void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); +void qemu_register_wakeup_notifier(Notifier *notifier); void qemu_system_shutdown_request(void); void qemu_system_powerdown_request(void); void qemu_system_debug_request(void); |