aboutsummaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/atapi.c8
-rw-r--r--hw/ide/core.c7
-rw-r--r--hw/ide/macio.c7
3 files changed, 2 insertions, 20 deletions
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 8af1cfdd7e..0adb27b799 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -352,14 +352,8 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)
s->bus->dma->aiocb = bdrv_aio_readv(s->bs, (int64_t)s->lba << 2,
&s->bus->dma->qiov, n * 4,
ide_atapi_cmd_read_dma_cb, s);
- if (!s->bus->dma->aiocb) {
- /* Note: media not present is the most likely case */
- ide_atapi_cmd_error(s, NOT_READY,
- ASC_MEDIUM_NOT_PRESENT);
- goto eot;
- }
-
return;
+
eot:
bdrv_acct_done(s->bs, &s->acct);
s->bus->dma->ops->add_status(s->bus->dma, BM_STATUS_INT);
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 49847bd3ea..7071326daa 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -718,18 +718,13 @@ static void ide_flush_cb(void *opaque, int ret)
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)
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index c09d2e0a35..40f60f018e 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -84,13 +84,6 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
m->aiocb = dma_bdrv_read(s->bs, &s->sg,
(int64_t)(s->lba << 2) + (s->io_buffer_index >> 9),
pmac_ide_atapi_transfer_cb, io);
- if (!m->aiocb) {
- qemu_sglist_destroy(&s->sg);
- /* Note: media not present is the most likely case */
- ide_atapi_cmd_error(s, NOT_READY,
- ASC_MEDIUM_NOT_PRESENT);
- goto done;
- }
return;
done: