qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] qcow2: Set zero flag for discarded clusters


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2] qcow2: Set zero flag for discarded clusters
Date: Mon, 17 Feb 2014 10:12:57 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 02/17/2014 07:45 AM, Kevin Wolf wrote:
> Instead of making the backing file contents visible again after a discard
> request, set the zero flag if possible (i.e. on version >= 3).
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block/qcow2-cluster.c  | 22 ++++++++++++++++++++--
>  tests/qemu-iotests/046 | 18 ++++++++++++++----
>  2 files changed, 34 insertions(+), 6 deletions(-)
> 

> +        if (!!(old_offset & QCOW_OFLAG_ZERO)) {

The !! is not necessary here; any non-zero value in a boolean context
gives the same result as an explicit conversion to 0-or-1.

But as that's cosmetic, I'm okay whether you leave it as is or simplify
it, when adding:

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]