QMP: Move STOP event into do_vm_stop()
authorLuiz Capitulino <lcapitulino@redhat.com>
Thu, 25 Feb 2010 15:06:59 +0000 (12:06 -0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 8 Mar 2010 17:30:01 +0000 (11:30 -0600)
I've introduced the STOP event in the main loop, this is wrong
as it will be only emitted if the io thread is enabled.

This fixes that by moving the STOP event to do_vm_stop().

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl.c

diff --git a/vl.c b/vl.c
index 10d8e34e50300c5d16c5dd62c6a40833ab345b4d..833113852f1c5e43dc1f536c2f15e7145f34f283 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3137,6 +3137,7 @@ static void do_vm_stop(int reason)
         vm_running = 0;
         pause_all_vcpus();
         vm_state_notify(0, reason);
+        monitor_protocol_event(QEVENT_STOP, NULL);
     }
 }
 
@@ -4105,7 +4106,6 @@ static void main_loop(void)
             qemu_irq_raise(qemu_system_powerdown);
         }
         if ((r = qemu_vmstop_requested())) {
-            monitor_protocol_event(QEVENT_STOP, NULL);
             vm_stop(r);
         }
     }