qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2 12/14] qemu-img: Make MapEntry a QAPI struct


From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH v2 12/14] qemu-img: Make MapEntry a QAPI struct
Date: Wed, 25 Nov 2015 12:37:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 25/11/2015 08:39, Fam Zheng wrote:
>           */
> -        if (next &&
> -            (next->flags & (BDRV_BLOCK_DATA|BDRV_BLOCK_ZERO)) != 
> BDRV_BLOCK_DATA) {
> -            next->flags &= ~BDRV_BLOCK_DATA;
> -            next->flags |= BDRV_BLOCK_ZERO;
> +        if (next && !next->data) {
> +            next->zero = true;

                before          after
0               ZERO            ZERO
DATA            DATA            DATA
DATA|ZERO       ZERO            DATA|ZERO
ZERO            ZERO            ZERO

This would not coalesce 0 with DATA|ZERO.

I think you need to do exactly as in the older code: test (!next->data
|| next->zero), and clear next->data.

Paolo



reply via email to

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