Patchwork [2/5] QMP: Move STOP event into do_vm_stop()

login
register
mail settings
Submitter Luiz Capitulino
Date Feb. 25, 2010, 3:06 p.m.
Message ID <1267110422-25873-3-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/46243/
State New
Headers show

Comments

Luiz Capitulino - Feb. 25, 2010, 3:06 p.m.
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>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index db7a178..1735dd2 100644
--- a/vl.c
+++ b/vl.c
@@ -3106,6 +3106,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);
     }
 }
 
@@ -4073,7 +4074,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);
         }
     }