qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 12/14] backup: Use BlockBackend for I/O


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 12/14] backup: Use BlockBackend for I/O
Date: Tue, 24 May 2016 19:53:40 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 05/24/2016 07:47 AM, Kevin Wolf wrote:
> This changes the backup block job to use the job's BlockBackend for
> performing its I/O. job->bs isn't used by the backup code any more
> afterwards.
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block/backup.c        | 46 +++++++++++++++++++++-------------------------
>  block/io.c            |  9 ---------
>  blockdev.c            |  4 +---
>  include/block/block.h |  2 --
>  trace-events          |  1 -
>  5 files changed, 22 insertions(+), 40 deletions(-)
> 

>  
> -        if (is_write_notifier) {
> -            ret = bdrv_co_readv_no_serialising(bs,
> -                                           start * sectors_per_cluster,
> -                                           n, &bounce_qiov);
> -        } else {
> -            ret = bdrv_co_readv(bs, start * sectors_per_cluster, n,
> -                                &bounce_qiov);
> -        }
> +        ret = blk_co_preadv(blk, start * job->cluster_size,
> +                            bounce_qiov.size, &bounce_qiov,
> +                            is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0);

See my question earlier in the series about whether we want a redundant
size parameter in blk_co_preadv() now that it is public.

>          if (ret < 0) {
>              trace_backup_do_cow_read_fail(job, start, ret);
>              if (error_is_read) {
> @@ -155,13 +150,11 @@ static int coroutine_fn backup_do_cow(BackupBlockJob 
> *job,
>          }
>  
>          if (buffer_is_zero(iov.iov_base, iov.iov_len)) {
> -            ret = bdrv_co_write_zeroes(job->target,
> -                                       start * sectors_per_cluster,
> -                                       n, BDRV_REQ_MAY_UNMAP);
> +            ret = blk_co_write_zeroes(job->target, start * job->cluster_size,
> +                                      n * BDRV_SECTOR_SIZE, 
> BDRV_REQ_MAY_UNMAP);

More rebasing fun.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]