qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3] block: Turn on "unmap" in active commit


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3] block: Turn on "unmap" in active commit
Date: Tue, 27 Sep 2016 08:29:47 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 09/27/2016 06:14 AM, Fam Zheng wrote:
> We already specified BDRV_O_UNMAP when opening images in 'qemu-img
> commit', but didn't turn on the "unmap" in the active commit job. This
> patch fixes that so that zeroed clusters in top image can be discarded
> which is desired in the virt-sparsify use case, where a temporary
> overlay is created and fstrim'ed before commiting back, to free space in
> the original image.
> 
> This also enables it for block-commit.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> v3: Change the right parameter.

Doesn't affect this patch, but it may be worth using the 'boxed':true
notation in the .json file to make it more compact to pass job
information around via a struct rather than a large mess of parameters
where you are likely to get the wrong one.

> v2: Add "unmap" to block-commit as well. [Kevin]
> ---
>  block/mirror.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/mirror.c b/block/mirror.c
> index f9d1fec..8847ec5 100644
> --- a/block/mirror.c
> +++ b/block/mirror.c
> @@ -1042,7 +1042,7 @@ void commit_active_start(const char *job_id, 
> BlockDriverState *bs,
>  
>      mirror_start_job(job_id, bs, base, NULL, speed, 0, 0,
>                       MIRROR_LEAVE_BACKING_CHAIN,
> -                     on_error, on_error, false, cb, opaque, &local_err,
> +                     on_error, on_error, true, cb, opaque, &local_err,
>                       &commit_active_job_driver, false, base, auto_complete);

-- 
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]