summaryrefslogtreecommitdiffstats
path: root/include/sysemu/runstate.h
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2021-01-11 16:20:20 +0100
committerLaurent Vivier2021-03-09 23:13:57 +0100
commit538f049704e9b7a07eeaf326af772fdd30d89576 (patch)
treea526a5fe441343bfa49001357e65ae9028e9a7e4 /include/sysemu/runstate.h
parentsysemu/runstate: Let runstate_is_running() return bool (diff)
downloadqemu-538f049704e9b7a07eeaf326af772fdd30d89576.tar.gz
qemu-538f049704e9b7a07eeaf326af772fdd30d89576.tar.xz
qemu-538f049704e9b7a07eeaf326af772fdd30d89576.zip
sysemu: Let VMChangeStateHandler take boolean 'running' argument
The 'running' argument from VMChangeStateHandler does not require other value than 0 / 1. Make it a plain boolean. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <20210111152020.1422021-3-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'include/sysemu/runstate.h')
-rw-r--r--include/sysemu/runstate.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/sysemu/runstate.h b/include/sysemu/runstate.h
index 3ab35a039a..a535691573 100644
--- a/include/sysemu/runstate.h
+++ b/include/sysemu/runstate.h
@@ -10,7 +10,7 @@ bool runstate_is_running(void);
bool runstate_needs_reset(void);
bool runstate_store(char *str, size_t size);
-typedef void VMChangeStateHandler(void *opaque, int running, RunState state);
+typedef void VMChangeStateHandler(void *opaque, bool running, RunState state);
VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
void *opaque);
@@ -20,7 +20,13 @@ VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
VMChangeStateHandler *cb,
void *opaque);
void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
-void vm_state_notify(int running, RunState state);
+/**
+ * vm_state_notify: Notify the state of the VM
+ *
+ * @running: whether the VM is running or not.
+ * @state: the #RunState of the VM.
+ */
+void vm_state_notify(bool running, RunState state);
static inline bool shutdown_caused_by_guest(ShutdownCause cause)
{