[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/4] ide/atapi: enable cancelable requests
From: |
Peter Lieven |
Subject: |
[Qemu-devel] [PATCH 4/4] ide/atapi: enable cancelable requests |
Date: |
Mon, 12 Oct 2015 14:27:25 +0200 |
Signed-off-by: Peter Lieven <address@hidden>
---
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
Re: [Qemu-devel] [PATCH V2 0/4] ide: avoid main-loop hang on CDROM/NFS failure, Stefan Hajnoczi, 2015/10/26