Skip to content

Commit

Permalink
block/stream: use buffer-based io
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Vladimir Sementsov-Ogievskiy authored and kevmw committed Apr 30, 2019
1 parent 08b6261 commit f4326ae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions block/stream.c
Expand Up @@ -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)
Expand Down

0 comments on commit f4326ae

Please sign in to comment.