From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkqkK-0003uo-By for qemu-devel@nongnu.org; Tue, 30 Sep 2008 21:43:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkqkI-0003uS-QG for qemu-devel@nongnu.org; Tue, 30 Sep 2008 21:43:18 -0400 Received: from [199.232.76.173] (port=41205 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkqkI-0003uN-ND for qemu-devel@nongnu.org; Tue, 30 Sep 2008 21:43:18 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43997 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkqkI-0000xS-8f for qemu-devel@nongnu.org; Tue, 30 Sep 2008 21:43:18 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KkqkH-0006XK-NW for qemu-devel@nongnu.org; Wed, 01 Oct 2008 01:43:17 +0000 Received: from balrog by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KkqkH-0006XF-Ec for qemu-devel@nongnu.org; Wed, 01 Oct 2008 01:43:17 +0000 MIME-Version: 1.0 Errors-To: balrog Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrzej Zaborowski Message-Id: Date: Wed, 01 Oct 2008 01:43:17 +0000 Subject: [Qemu-devel] [5369] Check that asynchronous (DMA) submission succeeds (Ian Jackson). Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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)