diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-11-14 14:56:32 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-06-26 14:51:14 +0200 |
commit | 3e248cdcd907df82da63f89905e2e1bd20d44ab6 (patch) | |
tree | 44b6d03c4c0d43f546d1467a350477cc171e9152 | |
parent | 453e53e2a1128b85a03af7fd597292c9b6f8a9a0 (diff) | |
download | qemu-3e248cdcd907df82da63f89905e2e1bd20d44ab6.zip qemu-3e248cdcd907df82da63f89905e2e1bd20d44ab6.tar.gz qemu-3e248cdcd907df82da63f89905e2e1bd20d44ab6.tar.bz2 |
qed: Make qed_aio_read_data() synchronous
Note that this code is generally not running in coroutine context, so
this is an actual blocking synchronous operation. We'll fix this in a
moment.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | block/qed.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/block/qed.c b/block/qed.c index 8c493bb..cfebbae 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1321,9 +1321,11 @@ static void qed_aio_read_data(void *opaque, int ret, } BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); - bdrv_aio_readv(bs->file, offset / BDRV_SECTOR_SIZE, - &acb->cur_qiov, acb->cur_qiov.size / BDRV_SECTOR_SIZE, - qed_aio_next_io_cb, acb); + ret = bdrv_preadv(bs->file, offset, &acb->cur_qiov); + if (ret < 0) { + goto err; + } + qed_aio_next_io(acb, 0); return; err: |