diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2019-02-18 17:09:14 +0300 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2019-02-22 09:42:13 +0000 |
commit | ee7a883ace6f19d3b3d2c2ef7e4ca86232ab523a (patch) | |
tree | 119d38c78252c51f540b9ee4c6dbfbe64c6df59c /block | |
parent | 31e0a6e1af78fcca60fa30c345fb7b54d49da0c9 (diff) | |
download | qemu-ee7a883ace6f19d3b3d2c2ef7e4ca86232ab523a.zip qemu-ee7a883ace6f19d3b3d2c2ef7e4ca86232ab523a.tar.gz qemu-ee7a883ace6f19d3b3d2c2ef7e4ca86232ab523a.tar.bz2 |
block/commit: use QEMU_IOVEC_INIT_BUF
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/commit.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/block/commit.c b/block/commit.c index 53148e6..d500a93 100644 --- a/block/commit.c +++ b/block/commit.c @@ -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) { |