Revision e07bbac5

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

  
175 175
#ifdef CONFIG_LINUX
b/gdbstub.c
2194 2194
    const char *type;
2195 2195
    int ret;
2196 2196

  
2197
    if (running || (reason != EXCP_DEBUG && reason != EXCP_INTERRUPT) ||
2198
        s->state == RS_INACTIVE || s->state == RS_SYSCALL)
2197
    if (running || (reason != VMSTOP_DEBUG && reason != VMSTOP_USER) ||
2198
        s->state == RS_INACTIVE || s->state == RS_SYSCALL) {
2199 2199
        return;
2200

  
2200
    }
2201 2201
    /* disable single step if it was enable */
2202 2202
    cpu_single_step(env, 0);
2203 2203

  
2204
    if (reason == EXCP_DEBUG) {
2204
    if (reason == VMSTOP_DEBUG) {
2205 2205
        if (env->watchpoint_hit) {
2206 2206
            switch (env->watchpoint_hit->flags & BP_MEM_ACCESS) {
2207 2207
            case BP_MEM_READ:
......
2252 2252
    gdb_current_syscall_cb = cb;
2253 2253
    s->state = RS_SYSCALL;
2254 2254
#ifndef CONFIG_USER_ONLY
2255
    vm_stop(EXCP_DEBUG);
2255
    vm_stop(VMSTOP_DEBUG);
2256 2256
#endif
2257 2257
    s->state = RS_IDLE;
2258 2258
    va_start(va, fmt);
......
2326 2326
    if (vm_running) {
2327 2327
        /* when the CPU is running, we cannot do anything except stop
2328 2328
           it when receiving a char */
2329
        vm_stop(EXCP_INTERRUPT);
2329
        vm_stop(VMSTOP_USER);
2330 2330
    } else
2331 2331
#endif
2332 2332
    {
......
2588 2588
{
2589 2589
    switch (event) {
2590 2590
    case CHR_EVENT_OPENED:
2591
        vm_stop(EXCP_INTERRUPT);
2591
        vm_stop(VMSTOP_USER);
2592 2592
        gdb_has_xml = 0;
2593 2593
        break;
2594 2594
    default:
......
2628 2628
#ifndef _WIN32
2629 2629
static void gdb_sigterm_handler(int signal)
2630 2630
{
2631
    if (vm_running)
2632
        vm_stop(EXCP_INTERRUPT);
2631
    if (vm_running) {
2632
        vm_stop(VMSTOP_USER);
2633
    }
2633 2634
}
2634 2635
#endif
2635 2636

  
b/hw/ide/core.c
465 465
        s->bus->dma->ops->set_unit(s->bus->dma, s->unit);
466 466
        s->bus->dma->ops->add_status(s->bus->dma, op);
467 467
        bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);
468
        vm_stop(0);
468
        vm_stop(VMSTOP_DISKFULL);
469 469
    } else {
470 470
        if (op & BM_STATUS_DMA_RETRY) {
471 471
            dma_buf_commit(s, 0);
b/hw/scsi-disk.c
239 239
        r->status |= SCSI_REQ_STATUS_RETRY | type;
240 240

  
241 241
        bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);
242
        vm_stop(0);
242
        vm_stop(VMSTOP_DISKFULL);
243 243
    } else {
244 244
        if (type == SCSI_REQ_STATUS_RETRY_READ) {
245 245
            r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, 0);
b/hw/virtio-blk.c
78 78
        req->next = s->rq;
79 79
        s->rq = req;
80 80
        bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read);
81
        vm_stop(0);
81
        vm_stop(VMSTOP_DISKFULL);
82 82
    } else {
83 83
        virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
84 84
        bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read);
b/hw/watchdog.c
132 132

  
133 133
    case WDT_PAUSE:             /* same as 'stop' command in monitor */
134 134
        watchdog_mon_event("pause");
135
        vm_stop(0);
135
        vm_stop(VMSTOP_WATCHDOG);
136 136
        break;
137 137

  
138 138
    case WDT_DEBUG:
b/kvm-all.c
994 994

  
995 995
    if (ret < 0) {
996 996
        cpu_dump_state(env, stderr, fprintf, CPU_DUMP_CODE);
997
        vm_stop(0);
997
        vm_stop(VMSTOP_PANIC);
998 998
        env->exit_request = 1;
999 999
    }
1000 1000
    if (env->exit_request) {
b/migration.c
378 378
        int old_vm_running = vm_running;
379 379

  
380 380
        DPRINTF("done iterating\n");
381
        vm_stop(0);
381
        vm_stop(VMSTOP_MIGRATE);
382 382

  
383 383
        if ((qemu_savevm_state_complete(s->mon, s->file)) < 0) {
384 384
            if (old_vm_running) {
b/monitor.c
1255 1255
 */
1256 1256
static int do_stop(Monitor *mon, const QDict *qdict, QObject **ret_data)
1257 1257
{
1258
    vm_stop(EXCP_INTERRUPT);
1258
    vm_stop(VMSTOP_USER);
1259 1259
    return 0;
1260 1260
}
1261 1261

  
......
2783 2783
    int saved_vm_running  = vm_running;
2784 2784
    const char *name = qdict_get_str(qdict, "name");
2785 2785

  
2786
    vm_stop(0);
2786
    vm_stop(VMSTOP_LOADVM);
2787 2787

  
2788 2788
    if (load_vmstate(name) == 0 && saved_vm_running) {
2789 2789
        vm_start();
b/savevm.c
1575 1575
    int ret;
1576 1576

  
1577 1577
    saved_vm_running = vm_running;
1578
    vm_stop(0);
1578
    vm_stop(VMSTOP_SAVEVM);
1579 1579

  
1580 1580
    if (qemu_savevm_state_blocked(mon)) {
1581 1581
        ret = -EINVAL;
......
1904 1904
    }
1905 1905

  
1906 1906
    saved_vm_running = vm_running;
1907
    vm_stop(0);
1907
    vm_stop(VMSTOP_SAVEVM);
1908 1908

  
1909 1909
    memset(sn, 0, sizeof(*sn));
1910 1910

  
b/sysemu.h
37 37
                                                     void *opaque);
38 38
void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
39 39

  
40
#define VMSTOP_USER      0
41
#define VMSTOP_DEBUG     1
42
#define VMSTOP_SHUTDOWN  2
43
#define VMSTOP_DISKFULL  3
44
#define VMSTOP_WATCHDOG  4
45
#define VMSTOP_PANIC     5
46
#define VMSTOP_SAVEVM    6
47
#define VMSTOP_LOADVM    7
48
#define VMSTOP_MIGRATE   8
49

  
40 50
void vm_start(void);
41 51
void vm_stop(int reason);
42 52

  
b/vl.c
1433 1433
        if (qemu_shutdown_requested()) {
1434 1434
            monitor_protocol_event(QEVENT_SHUTDOWN, NULL);
1435 1435
            if (no_shutdown) {
1436
                vm_stop(0);
1436
                vm_stop(VMSTOP_SHUTDOWN);
1437 1437
                no_shutdown = 0;
1438 1438
            } else
1439 1439
                break;

Also available in: Unified diff