Revision 8cf71710

b/cpus.c
168 168
static void cpu_debug_handler(CPUState *env)
169 169
{
170 170
    gdb_set_stop_cpu(env);
171
    debug_requested = VMSTOP_DEBUG;
172
    vm_stop(VMSTOP_DEBUG);
171
    qemu_system_debug_request();
173 172
}
174 173

  
175 174
#ifdef CONFIG_LINUX
......
990 989
    qemu_event_increment();
991 990
}
992 991

  
993
static void qemu_system_vmstop_request(int reason)
994
{
995
    vmstop_requested = reason;
996
    qemu_notify_event();
997
}
998

  
999 992
void cpu_stop_current(void)
1000 993
{
1001 994
    if (cpu_single_env) {
b/cpus.h
11 11
/* vl.c */
12 12
extern int smp_cores;
13 13
extern int smp_threads;
14
extern int debug_requested;
15
extern int vmstop_requested;
16 14
void vm_state_notify(int running, int reason);
17 15
bool cpu_exec_all(void);
18 16
void set_numa_modes(void);
b/sysemu.h
61 61
void qemu_system_reset_request(void);
62 62
void qemu_system_shutdown_request(void);
63 63
void qemu_system_powerdown_request(void);
64
void qemu_system_debug_request(void);
65
void qemu_system_vmstop_request(int reason);
64 66
int qemu_shutdown_requested(void);
65 67
int qemu_reset_requested(void);
66 68
int qemu_powerdown_requested(void);
b/vl.c
1217 1217
static int reset_requested;
1218 1218
static int shutdown_requested;
1219 1219
static int powerdown_requested;
1220
int debug_requested;
1221
int vmstop_requested;
1220
static int debug_requested;
1221
static int vmstop_requested;
1222 1222

  
1223 1223
int qemu_shutdown_requested(void)
1224 1224
{
......
1312 1312
    qemu_notify_event();
1313 1313
}
1314 1314

  
1315
void qemu_system_debug_request(void)
1316
{
1317
    debug_requested = 1;
1318
    vm_stop(VMSTOP_DEBUG);
1319
}
1320

  
1321
void qemu_system_vmstop_request(int reason)
1322
{
1323
    vmstop_requested = reason;
1324
    qemu_notify_event();
1325
}
1326

  
1315 1327
void main_loop_wait(int nonblocking)
1316 1328
{
1317 1329
    IOHandlerRecord *ioh;
......
1427 1439
        dev_time += profile_getclock() - ti;
1428 1440
#endif
1429 1441

  
1430
        if ((r = qemu_debug_requested())) {
1431
            vm_stop(r);
1442
        if (qemu_debug_requested()) {
1443
            vm_stop(VMSTOP_DEBUG);
1432 1444
        }
1433 1445
        if (qemu_shutdown_requested()) {
1434 1446
            monitor_protocol_event(QEVENT_SHUTDOWN, NULL);

Also available in: Unified diff