From: Michael Tokarev Date: Wed, 13 Aug 2014 07:23:31 +0000 (+0400) Subject: ide: only constrain read/write requests to drive size, not other types X-Git-Tag: v2.2.0-rc0~173^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d66168ed687325aa6d338ce3a3cff18ce3098ed6;p=thirdparty%2Fqemu.git ide: only constrain read/write requests to drive size, not other types Commit 58ac321135a introduced a check to ide dma processing which constrains all requests to drive size. However, apparently, some valid requests (like TRIM) does not fit in this constraint, and fails in 2.1. So check the range only for reads and writes. Cc: qemu-stable@nongnu.org Signed-off-by: Michael Tokarev Signed-off-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- diff --git a/hw/ide/core.c b/hw/ide/core.c index 82dd4afd840..b48127f921d 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -692,7 +692,8 @@ void ide_dma_cb(void *opaque, int ret) sector_num, n, s->dma_cmd); #endif - if (!ide_sect_range_ok(s, sector_num, n)) { + if ((s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) && + !ide_sect_range_ok(s, sector_num, n)) { dma_buf_commit(s); ide_dma_error(s); return;