qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [5369] Check that asynchronous (DMA) submission succeeds (I


From: Andrzej Zaborowski
Subject: [Qemu-devel] [5369] Check that asynchronous (DMA) submission succeeds (Ian Jackson).
Date: Wed, 01 Oct 2008 01:43:17 +0000

Revision: 5369
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5369
Author:   balrog
Date:     2008-10-01 01:43:16 +0000 (Wed, 01 Oct 2008)

Log Message:
-----------
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 <address@hidden>

Modified Paths:
--------------
    trunk/hw/ide.c

Modified: trunk/hw/ide.c
===================================================================
--- trunk/hw/ide.c      2008-10-01 01:13:37 UTC (rev 5368)
+++ trunk/hw/ide.c      2008-10-01 01:43:16 UTC (rev 5369)
@@ -738,6 +738,14 @@
     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 @@
 #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 @@
 #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)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]