Patchwork [03/23] Process vmstop requests in IO thread

login
register
mail settings
Submitter Marcelo Tosatti
Date Feb. 4, 2011, 3:47 p.m.
Message ID <00d6e393b0a59b558e86e73625c47610a7382f19.1296834446.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/81915/
State New
Headers show

Comments

Marcelo Tosatti - Feb. 4, 2011, 3:47 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

A pending vmstop request is also a reason to leave the inner main loop.
So far we ignored it, and pending stop requests issued over VCPU threads
were simply ignored.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
---
 vl.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index b1dc3ff..57b4c9f 100644
--- a/vl.c
+++ b/vl.c
@@ -1391,15 +1391,11 @@  void main_loop_wait(int nonblocking)
 
 static int vm_can_run(void)
 {
-    if (powerdown_requested)
-        return 0;
-    if (reset_requested)
-        return 0;
-    if (shutdown_requested)
-        return 0;
-    if (debug_requested)
-        return 0;
-    return 1;
+    return !(powerdown_requested ||
+             reset_requested ||
+             shutdown_requested ||
+             debug_requested ||
+             vmstop_requested);
 }
 
 qemu_irq qemu_system_powerdown;