summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-06-05 14:53:58 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-06-23 16:36:13 +0800
commit74892d2468b9f0c56b915ce94848d6f7fac39740 (patch)
tree36cc2ea403155751b9ca9fa29ad29f34854102cd /include
parent5d5da114b39d3cf187a69dcf5eaca7eaf886c041 (diff)
downloadhqemu-74892d2468b9f0c56b915ce94848d6f7fac39740.zip
hqemu-74892d2468b9f0c56b915ce94848d6f7fac39740.tar.gz
vl: allow other threads to do qemu_system_vmstop_request
There patch protects vmstop_requested with a lock and introduces qemu_system_vmstop_request_prepare. Together with the new call to qemu_vmstop_requested in vm_start, qemu_system_vmstop_request_prepare avoids a race where the VM could remain stopped even though the iostatus of a block device has already been set (for example). qemu_system_vmstop_request_prepare however also lets the caller thread delay observation of the state change until it has itself communicated that change to the user. This delay avoids any possibility of a wrong reordering of the BLOCK_IO_ERROR event and the subsequent STOP event. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sysemu/sysemu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 277230d..6b4cc13 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -62,6 +62,7 @@ void qemu_system_powerdown_request(void);
void qemu_register_powerdown_notifier(Notifier *notifier);
void qemu_system_debug_request(void);
void qemu_system_vmstop_request(RunState reason);
+void qemu_system_vmstop_request_prepare(void);
int qemu_shutdown_requested_get(void);
int qemu_reset_requested_get(void);
void qemu_system_killed(int signal, pid_t pid);
OpenPOWER on IntegriCloud