}
}
- static void dma_buf_commit(IDEState *s, int is_write)
+ static void dma_buf_commit(IDEState *s)
{
qemu_sglist_destroy(&s->sg);
}
bdrv_iostatus_set_err(s->bs, error);
} else {
if (op & BM_STATUS_DMA_RETRY) {
- dma_buf_commit(s, 0);
+ dma_buf_commit(s);
ide_dma_error(s);
} else {
ide_rw_error(s);
int n;
int64_t sector_num;
-handle_rw_error:
if (ret < 0) {
int op = BM_STATUS_DMA_RETRY;
n = s->io_buffer_size >> 9;
sector_num = ide_get_sector(s);
if (n > 0) {
- dma_buf_commit(s, ide_cmd_is_read(s));
+ dma_buf_commit(s);
sector_num += n;
ide_set_sector(s, sector_num);
s->nsector -= n;
ide_issue_trim, ide_dma_cb, s, true);
break;
}
-
- if (!s->bus->dma->aiocb) {
- ret = -1;
- goto handle_rw_error;
- }
return;
eot:
void ide_flush_cache(IDEState *s)
{
- BlockDriverAIOCB *acb;
-
if (s->bs == NULL) {
ide_flush_cb(s, 0);
return;
}
bdrv_acct_start(s->bs, &s->acct, 0, BDRV_ACCT_FLUSH);
- acb = bdrv_aio_flush(s->bs, ide_flush_cb, s);
- if (acb == NULL) {
- ide_flush_cb(s, -EIO);
- }
+ bdrv_aio_flush(s->bs, ide_flush_cb, s);
}
static void ide_cfata_metadata_inquiry(IDEState *s)