hw/elf_ops: Fix a typo
[qemu/ar7.git] / include / sysemu / runstate.h
blobe557f470d421f2f46d812b5e990905b3c6dbba45
1 #ifndef SYSEMU_RUNSTATE_H
2 #define SYSEMU_RUNSTATE_H
4 #include "qapi/qapi-types-run-state.h"
5 #include "qemu/notify.h"
7 bool runstate_check(RunState state);
8 void runstate_set(RunState new_state);
9 int runstate_is_running(void);
10 bool runstate_needs_reset(void);
11 bool runstate_store(char *str, size_t size);
13 typedef void VMChangeStateHandler(void *opaque, int running, RunState state);
15 VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
16 void *opaque);
17 VMChangeStateEntry *qemu_add_vm_change_state_handler_prio(
18 VMChangeStateHandler *cb, void *opaque, int priority);
19 VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
20 VMChangeStateHandler *cb,
21 void *opaque);
22 void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
23 void vm_state_notify(int running, RunState state);
25 static inline bool shutdown_caused_by_guest(ShutdownCause cause)
27 return cause >= SHUTDOWN_CAUSE_GUEST_SHUTDOWN;
30 void vm_start(void);
31 int vm_prepare_start(void);
32 int vm_stop(RunState state);
33 int vm_stop_force_state(RunState state);
34 int vm_shutdown(void);
36 typedef enum WakeupReason {
37 /* Always keep QEMU_WAKEUP_REASON_NONE = 0 */
38 QEMU_WAKEUP_REASON_NONE = 0,
39 QEMU_WAKEUP_REASON_RTC,
40 QEMU_WAKEUP_REASON_PMTIMER,
41 QEMU_WAKEUP_REASON_OTHER,
42 } WakeupReason;
44 void qemu_system_reset_request(ShutdownCause reason);
45 void qemu_system_suspend_request(void);
46 void qemu_register_suspend_notifier(Notifier *notifier);
47 bool qemu_wakeup_suspend_enabled(void);
48 void qemu_system_wakeup_request(WakeupReason reason, Error **errp);
49 void qemu_system_wakeup_enable(WakeupReason reason, bool enabled);
50 void qemu_register_wakeup_notifier(Notifier *notifier);
51 void qemu_register_wakeup_support(void);
52 void qemu_system_shutdown_request(ShutdownCause reason);
53 void qemu_system_powerdown_request(void);
54 void qemu_register_powerdown_notifier(Notifier *notifier);
55 void qemu_register_shutdown_notifier(Notifier *notifier);
56 void qemu_system_debug_request(void);
57 void qemu_system_vmstop_request(RunState reason);
58 void qemu_system_vmstop_request_prepare(void);
59 bool qemu_vmstop_requested(RunState *r);
60 ShutdownCause qemu_shutdown_requested_get(void);
61 ShutdownCause qemu_reset_requested_get(void);
62 void qemu_system_killed(int signal, pid_t pid);
63 void qemu_system_reset(ShutdownCause reason);
64 void qemu_system_guest_panicked(GuestPanicInformation *info);
65 void qemu_system_guest_crashloaded(GuestPanicInformation *info);
67 #endif