From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcDQ-0000al-DO for qemu-devel@nongnu.org; Mon, 12 Oct 2015 08:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlcDO-0000mb-6o for qemu-devel@nongnu.org; Mon, 12 Oct 2015 08:28:32 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:60356 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlcDN-0000mK-UM for qemu-devel@nongnu.org; Mon, 12 Oct 2015 08:28:30 -0400 From: Peter Lieven Date: Mon, 12 Oct 2015 14:27:25 +0200 Message-Id: <1444652845-20642-5-git-send-email-pl@kamp.de> In-Reply-To: <1444652845-20642-1-git-send-email-pl@kamp.de> References: <1444652845-20642-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH 4/4] 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 e0cf066..8d38b1d 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -187,7 +187,7 @@ static int cd_read_sector(IDEState *s, int lba, void *buf) printf("cd_read_sector: lba=%d\n", lba); #endif - 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; } @@ -426,7 +426,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