summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-01 01:43:16 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-01 01:43:16 +0000
commit5604e090cba05e9ef881b5ff9ce09c6a2a1a476b (patch)
treee668aa867621dfb18d1d4494f179233985184915 /hw
parente162cfb07b7bee2d4527b860f13de39429733dfa (diff)
downloadqemu-5604e090cba05e9ef881b5ff9ce09c6a2a1a476b.tar.gz
qemu-5604e090cba05e9ef881b5ff9ce09c6a2a1a476b.tar.bz2
qemu-5604e090cba05e9ef881b5ff9ce09c6a2a1a476b.zip
Check that asynchronous (DMA) submission succeeds (Ian Jackson).
If it does not, abort the command immediately rather than dropping it on the floor. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5369 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/ide.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/ide.c b/hw/ide.c
index cddc0d55d5..686d372d18 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -738,6 +738,14 @@ static inline void ide_abort_command(IDEState *s)
s->error = ABRT_ERR;
}
+static inline void ide_dma_submit_check(IDEState *s,
+ BlockDriverCompletionFunc *dma_cb, BMDMAState *bm)
+{
+ if (bm->aiocb)
+ return;
+ dma_cb(bm, -1);
+}
+
static inline void ide_set_irq(IDEState *s)
{
BMDMAState *bm = s->bmdma;
@@ -954,6 +962,7 @@ static void ide_read_dma_cb(void *opaque, int ret)
#endif
bm->aiocb = bdrv_aio_read(s->bs, sector_num, s->io_buffer, n,
ide_read_dma_cb, bm);
+ ide_dma_submit_check(s, ide_read_dma_cb, bm);
}
static void ide_sector_read_dma(IDEState *s)
@@ -1065,6 +1074,7 @@ static void ide_write_dma_cb(void *opaque, int ret)
#endif
bm->aiocb = bdrv_aio_write(s->bs, sector_num, s->io_buffer, n,
ide_write_dma_cb, bm);
+ ide_dma_submit_check(s, ide_write_dma_cb, bm);
}
static void ide_sector_write_dma(IDEState *s)