static int ide_handle_rw_error(IDEState *s, int error, int op)

{

    bool is_read = (op & IDE_RETRY_READ) != 0;

    BlockErrorAction action = bdrv_get_error_action(s->bs, is_read, error);



    if (action == BLOCK_ERROR_ACTION_STOP) {

        s->bus->dma->ops->set_unit(s->bus->dma, s->unit);

        s->bus->error_status = op;

    } else if (action == BLOCK_ERROR_ACTION_REPORT) {

        if (op & IDE_RETRY_DMA) {

            dma_buf_commit(s);

            ide_dma_error(s);

        } else {

            ide_rw_error(s);

        }

    }

    bdrv_error_action(s->bs, action, is_read, error);

    return action != BLOCK_ERROR_ACTION_IGNORE;

}

static int ide_handle_rw_error(IDEState *s, int error, int op)

{

    bool is_read = (op & IDE_RETRY_READ) != 0;

    BlockErrorAction action = bdrv_get_error_action(s->bs, is_read, error);



    if (action == BLOCK_ERROR_ACTION_STOP) {

        s->bus->dma->ops->set_unit(s->bus->dma, s->unit);

        s->bus->error_status = op;

    } else if (action == BLOCK_ERROR_ACTION_REPORT) {

        if (op & IDE_RETRY_DMA) {

            dma_buf_commit(s);

            ide_dma_error(s);

        } else {

            ide_rw_error(s);

        }

    }

    bdrv_error_action(s->bs, action, is_read, error);

    return action != BLOCK_ERROR_ACTION_IGNORE;

}

static int FUNC_0(IDEState *VAR_0, int VAR_1, int VAR_2)

{

    bool is_read = (VAR_2 & IDE_RETRY_READ) != 0;

    BlockErrorAction action = bdrv_get_error_action(VAR_0->bs, is_read, VAR_1);



    if (action == BLOCK_ERROR_ACTION_STOP) {

        VAR_0->bus->dma->ops->set_unit(VAR_0->bus->dma, VAR_0->unit);

        VAR_0->bus->error_status = VAR_2;

    } else if (action == BLOCK_ERROR_ACTION_REPORT) {

        if (VAR_2 & IDE_RETRY_DMA) {

            dma_buf_commit(VAR_0);

            ide_dma_error(VAR_0);

        } else {

            ide_rw_error(VAR_0);

        }

    }

    bdrv_error_action(VAR_0->bs, action, is_read, VAR_1);

    return action != BLOCK_ERROR_ACTION_IGNORE;

}

static int FUNC_0(IDEState *VAR_0, int VAR_1, int VAR_2)
{ bool is_read = (VAR_2 & IDE_RETRY_READ) != 0; BlockErrorAction action = bdrv_get_error_action(VAR_0->bs, is_read, VAR_1); if (action == BLOCK_ERROR_ACTION_STOP) { VAR_0->bus->dma->ops->set_unit(VAR_0->bus->dma, VAR_0->unit); VAR_0->bus->error_status = VAR_2; } else if (action == BLOCK_ERROR_ACTION_REPORT) { if (VAR_2 & IDE_RETRY_DMA) { dma_buf_commit(VAR_0); ide_dma_error(VAR_0); } else { ide_rw_error(VAR_0); } } bdrv_error_action(VAR_0->bs, action, is_read, VAR_1); return action != BLOCK_ERROR_ACTION_IGNORE; }