提交 f4326aef 编写于 作者: V Vladimir Sementsov-Ogievskiy 提交者: Kevin Wolf

block/stream: use buffer-based io

Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 08b6261f
......@@ -42,12 +42,10 @@ static int coroutine_fn stream_populate(BlockBackend *blk,
int64_t offset, uint64_t bytes,
void *buf)
{
QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes);
assert(bytes < SIZE_MAX);
/* Copy-on-read the unallocated clusters */
return blk_co_preadv(blk, offset, qiov.size, &qiov, BDRV_REQ_COPY_ON_READ);
return blk_co_pread(blk, offset, bytes, buf, BDRV_REQ_COPY_ON_READ);
}
static void stream_abort(Job *job)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册