From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze0An-0000zn-BM for qemu-devel@nongnu.org; Mon, 21 Sep 2015 08:26:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze0Ai-0003uL-7y for qemu-devel@nongnu.org; Mon, 21 Sep 2015 08:26:21 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:40736 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze0Ah-0003tz-U5 for qemu-devel@nongnu.org; Mon, 21 Sep 2015 08:26:16 -0400 From: Peter Lieven Date: Mon, 21 Sep 2015 14:25:27 +0200 Message-Id: <1442838328-23117-5-git-send-email-pl@kamp.de> In-Reply-To: <1442838328-23117-1-git-send-email-pl@kamp.de> References: <1442838328-23117-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH 4/5] ide/atapi: enable cancelable requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: kwolf@redhat.com, stefanha@gmail.com, jcody@redhat.com, jsnow@redhat.com, Peter Lieven Signed-off-by: Peter Lieven --- hw/ide/atapi.c | 4 ++-- hw/ide/core.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index b209ed9..ab45495 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -141,7 +141,7 @@ static int cd_read_sector(IDEState *s, int lba, void *buf, int sector_size) s->iov.iov_len = 4 * BDRV_SECTOR_SIZE; qemu_iovec_init_external(&s->qiov, &s->iov, 1); - if (blk_aio_readv(s->blk, (int64_t)lba << 2, &s->qiov, 4, + if (ide_readv_cancelable(s, (int64_t)lba << 2, &s->qiov, 4, cd_read_sector_cb, s) == NULL) { return -EIO; } @@ -368,7 +368,7 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret) s->bus->dma->iov.iov_len = n * 4 * 512; qemu_iovec_init_external(&s->bus->dma->qiov, &s->bus->dma->iov, 1); - s->bus->dma->aiocb = blk_aio_readv(s->blk, (int64_t)s->lba << 2, + s->bus->dma->aiocb = ide_readv_cancelable(s, (int64_t)s->lba << 2, &s->bus->dma->qiov, n * 4, ide_atapi_cmd_read_dma_cb, s); if (s->bus->dma->aiocb == NULL) { diff --git a/hw/ide/core.c b/hw/ide/core.c index 24547ce..5c7a346 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2330,6 +2330,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind, if (kind == IDE_CD) { blk_set_dev_ops(blk, &ide_cd_block_ops, s); blk_set_guest_block_size(blk, 2048); + s->requests_cancelable = true; } else { if (!blk_is_inserted(s->blk)) { error_report("Device needs media, but drive is empty"); -- 1.9.1