core.c (3cfdd0da7e513e740b759a2abec49db3c086d6e2) | core.c (329c0a48a92664eb48b70993c0f2473b37aa7429) |
---|---|
1/* 2 * QEMU IDE disk and CD/DVD-ROM Emulator 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * Copyright (c) 2006 Openedhand Ltd. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 505 unchanged lines hidden (view full) --- 514} 515 516static int ide_handle_rw_error(IDEState *s, int error, int op) 517{ 518 int is_read = (op & BM_STATUS_RETRY_READ); 519 BlockErrorAction action = bdrv_get_on_error(s->bs, is_read); 520 521 if (action == BLOCK_ERR_IGNORE) { | 1/* 2 * QEMU IDE disk and CD/DVD-ROM Emulator 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * Copyright (c) 2006 Openedhand Ltd. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a copy 8 * of this software and associated documentation files (the "Software"), to deal --- 505 unchanged lines hidden (view full) --- 514} 515 516static int ide_handle_rw_error(IDEState *s, int error, int op) 517{ 518 int is_read = (op & BM_STATUS_RETRY_READ); 519 BlockErrorAction action = bdrv_get_on_error(s->bs, is_read); 520 521 if (action == BLOCK_ERR_IGNORE) { |
522 bdrv_mon_event(s->bs, BDRV_ACTION_IGNORE, is_read); | 522 bdrv_emit_qmp_error_event(s->bs, BDRV_ACTION_IGNORE, is_read); |
523 return 0; 524 } 525 526 if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC) 527 || action == BLOCK_ERR_STOP_ANY) { 528 s->bus->dma->ops->set_unit(s->bus->dma, s->unit); 529 s->bus->error_status = op; | 523 return 0; 524 } 525 526 if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC) 527 || action == BLOCK_ERR_STOP_ANY) { 528 s->bus->dma->ops->set_unit(s->bus->dma, s->unit); 529 s->bus->error_status = op; |
530 bdrv_mon_event(s->bs, BDRV_ACTION_STOP, is_read); | 530 bdrv_emit_qmp_error_event(s->bs, BDRV_ACTION_STOP, is_read); |
531 vm_stop(RUN_STATE_IO_ERROR); 532 bdrv_iostatus_set_err(s->bs, error); 533 } else { 534 if (op & BM_STATUS_DMA_RETRY) { 535 dma_buf_commit(s); 536 ide_dma_error(s); 537 } else { 538 ide_rw_error(s); 539 } | 531 vm_stop(RUN_STATE_IO_ERROR); 532 bdrv_iostatus_set_err(s->bs, error); 533 } else { 534 if (op & BM_STATUS_DMA_RETRY) { 535 dma_buf_commit(s); 536 ide_dma_error(s); 537 } else { 538 ide_rw_error(s); 539 } |
540 bdrv_mon_event(s->bs, BDRV_ACTION_REPORT, is_read); | 540 bdrv_emit_qmp_error_event(s->bs, BDRV_ACTION_REPORT, is_read); |
541 } 542 543 return 1; 544} 545 546void ide_dma_cb(void *opaque, int ret) 547{ 548 IDEState *s = opaque; --- 1696 unchanged lines hidden --- | 541 } 542 543 return 1; 544} 545 546void ide_dma_cb(void *opaque, int ret) 547{ 548 IDEState *s = opaque; --- 1696 unchanged lines hidden --- |