qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/1] mirror: do not increase offset during in


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 1/1] mirror: do not increase offset during initial zero_or_discard phase
Date: Thu, 2 Feb 2017 09:17:17 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

On 02/02/2017 08:25 AM, Denis V. Lunev wrote:
> From: Anton Nefedov <address@hidden>
> 
> If explicit zeroing out before mirroring is required for the target image,
> it moves the block job offset counter to EOF, then offset and len counters
> count the image size twice. There is no harm but stats are confusing,
> specifically the progress of the operation is always reported as 99% by
> management tools.
> 
> The patch skips offset increase for the first "technical" pass over the
> image. This should not cause any further harm.
> 
> Signed-off-by: Anton Nefedov <address@hidden>
> Signed-off-by: Denis V. Lunev <address@hidden>
> CC: Jeff Cody <address@hidden>
> CC: Kevin Wolf <address@hidden>
> CC: Max Reitz <address@hidden>
> CC: Eric Blake <address@hidden>
> ---

> +    bool initial_zeroing_ongoing;

Long name. With a bit of bikeshedding, I might have used 'init_pass' for
a shorter name (particularly if some later patch introduces another
aspect of initialization that is not zeroing but is worth ignoring with
respects to progress reporting).

>  } MirrorBlockJob;
>  
>  typedef struct MirrorOp {
> @@ -117,9 +118,10 @@ static void mirror_iteration_done(MirrorOp *op, int ret)
>          if (s->cow_bitmap) {
>              bitmap_set(s->cow_bitmap, chunk_num, nb_chunks);
>          }
> -        s->common.offset += (uint64_t)op->nb_sectors * BDRV_SECTOR_SIZE;
> +        if (!s->initial_zeroing_ongoing) {
> +            s->common.offset += (uint64_t)op->nb_sectors * BDRV_SECTOR_SIZE;
> +        }
>      }
> -
>      qemu_iovec_destroy(&op->qiov);

Why are you deleting the blank line?

Other than naming, the patch looks reasonable.  If you spin a v3 with
only the name changed, you can add:

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]