qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [5369] Check that asynchronous (DMA) submission succeeds (Ian Jackson).
@ 2008-10-01  1:43 Andrzej Zaborowski
  0 siblings, 0 replies; only message in thread
From: Andrzej Zaborowski @ 2008-10-01  1:43 UTC (permalink / raw)
  To: qemu-devel

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 <ian.jackson@eu.citrix.com>

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-01  1:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-01  1:43 [Qemu-devel] [5369] Check that asynchronous (DMA) submission succeeds (Ian Jackson) Andrzej Zaborowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).