[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v4 04/21] stream: Drop reached_end for stream_co
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH v4 04/21] stream: Drop reached_end for stream_complete() |
Date: |
Thu, 6 Jul 2017 12:38:49 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 05.07.2017 um 23:08 hat Eric Blake geschrieben:
> stream_complete() skips the work of rewriting the backing file if
> the job was cancelled, if data->reached_end is false, or if there
> was an error detected (non-zero data->ret) during the streaming.
> But note that in stream_run(), data->reached_end is only set if the
> loop ran to completion, and data->ret is only 0 in two cases:
> either the loop ran to completion (possibly by cancellation, but
> stream_complete checks for that), or we took an early goto out
> because there is no bs->backing. Thus, we can preserve the same
> semantics without the use of reached_end, by merely checking for
> bs->backing (and logically, if there was no backing file, streaming
> is a no-op, so there is no backing file to rewrite).
>
> Suggested-by: Kevin Wolf <address@hidden>
> Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
- [Qemu-block] [PATCH v4 00/21] make bdrv_is_allocated[_above] byte-based, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 03/21] stream: Switch stream_populate() to byte-based, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 01/21] blockjob: Track job ratelimits via bytes, not sectors, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 04/21] stream: Drop reached_end for stream_complete(), Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 07/21] commit: Switch commit_run() to byte-based, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 06/21] commit: Switch commit_populate() to byte-based, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 05/21] stream: Switch stream_run() to byte-based, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 02/21] trace: Show blockjob actions via bytes, not sectors, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 08/21] mirror: Switch MirrorBlockJob to byte-based, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 09/21] mirror: Switch mirror_do_zero_or_discard() to byte-based, Eric Blake, 2017/07/05
- [Qemu-block] [PATCH v4 10/21] mirror: Update signature of mirror_clip_sectors(), Eric Blake, 2017/07/05