Skip to content

Commit

Permalink
block/commit: use QEMU_IOVEC_INIT_BUF
Browse files Browse the repository at this point in the history
Use new QEMU_IOVEC_INIT_BUF() instead of
qemu_iovec_init_external( ... , 1), which simplifies the code.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190218140926.333779-6-vsementsov@virtuozzo.com
Message-Id: <20190218140926.333779-6-vsementsov@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
Vladimir Sementsov-Ogievskiy authored and stefanhaRH committed Feb 22, 2019
1 parent 31e0a6e commit ee7a883
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions block/commit.c
Expand Up @@ -47,14 +47,9 @@ static int coroutine_fn commit_populate(BlockBackend *bs, BlockBackend *base,
void *buf)
{
int ret = 0;
QEMUIOVector qiov;
struct iovec iov = {
.iov_base = buf,
.iov_len = bytes,
};
QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes);

assert(bytes < SIZE_MAX);
qemu_iovec_init_external(&qiov, &iov, 1);

ret = blk_co_preadv(bs, offset, qiov.size, &qiov, 0);
if (ret < 0) {
Expand Down

0 comments on commit ee7a883

Please sign in to comment.