Skip to content

Commit

Permalink
block/backup: 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-5-vsementsov@virtuozzo.com
Message-Id: <20190218140926.333779-5-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 ae5a959 commit 31e0a6e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions block/backup.c
Expand Up @@ -107,7 +107,6 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
void **bounce_buffer)
{
int ret;
struct iovec iov;
QEMUIOVector qiov;
BlockBackend *blk = job->common.blk;
int nbytes;
Expand All @@ -119,9 +118,7 @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job,
if (!*bounce_buffer) {
*bounce_buffer = blk_blockalign(blk, job->cluster_size);
}
iov.iov_base = *bounce_buffer;
iov.iov_len = nbytes;
qemu_iovec_init_external(&qiov, &iov, 1);
qemu_iovec_init_buf(&qiov, *bounce_buffer, nbytes);

ret = blk_co_preadv(blk, start, qiov.size, &qiov, read_flags);
if (ret < 0) {
Expand Down

0 comments on commit 31e0a6e

Please sign in to comment.