diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-02-07 12:19:16 +0100 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-02-14 12:39:46 -0200 |
commit | 8cf71710f068f9c50ce420b1dd4ef71c2f9b2a8d (patch) | |
tree | df640713df1e55ca25143270a673196712427f73 /vl.c | |
parent | e07bbac542d45cb246f393f343eb3b867fed4de1 (diff) |
Refactor debug and vmstop request interface
Instead of fiddling with debug_requested and vmstop_requested directly,
introduce qemu_system_debug_request and turn qemu_system_vmstop_request
into a public interface. This aligns those services with exiting ones in
vl.c.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -1217,8 +1217,8 @@ static QTAILQ_HEAD(reset_handlers, QEMUResetEntry) reset_handlers = static int reset_requested; static int shutdown_requested; static int powerdown_requested; -int debug_requested; -int vmstop_requested; +static int debug_requested; +static int vmstop_requested; int qemu_shutdown_requested(void) { @@ -1312,6 +1312,18 @@ void qemu_system_powerdown_request(void) qemu_notify_event(); } +void qemu_system_debug_request(void) +{ + debug_requested = 1; + vm_stop(VMSTOP_DEBUG); +} + +void qemu_system_vmstop_request(int reason) +{ + vmstop_requested = reason; + qemu_notify_event(); +} + void main_loop_wait(int nonblocking) { IOHandlerRecord *ioh; @@ -1427,8 +1439,8 @@ static void main_loop(void) dev_time += profile_getclock() - ti; #endif - if ((r = qemu_debug_requested())) { - vm_stop(r); + if (qemu_debug_requested()) { + vm_stop(VMSTOP_DEBUG); } if (qemu_shutdown_requested()) { monitor_protocol_event(QEVENT_SHUTDOWN, NULL); |