qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 07/24] qcow2: add bitmaps extension


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 07/24] qcow2: add bitmaps extension
Date: Sun, 12 Feb 2017 04:11:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 03.02.2017 10:40, Vladimir Sementsov-Ogievskiy wrote:
> Add bitmap extension as specified in docs/specs/qcow2.txt.
> For now, just mirror extension header into Qcow2 state and check
> constraints.
> 
> For now, disable image resize if it has bitmaps. It will be fixed later.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  block/qcow2.c | 127 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
>  block/qcow2.h |  24 +++++++++++
>  2 files changed, 145 insertions(+), 6 deletions(-)
> 
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 96fb8a8f16..d263ab1ed7 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c

[...]

> @@ -1151,9 +1237,13 @@ static int qcow2_open(BlockDriverState *bs, QDict 
> *options, int flags,
>          goto fail;
>      }
>  
> -    /* Clear unknown autoclear feature bits */
> -    if (!bs->read_only && !(flags & BDRV_O_INACTIVE) && 
> s->autoclear_features) {
> -        s->autoclear_features = 0;
> +    if (!need_update_header) {
> +        /* Clear unknown autoclear feature bits */
> +        need_update_header = s->autoclear_features & ~QCOW2_AUTOCLEAR_MASK;
> +    }

Alternatively,

need_update_header |= s->autoclear_features & ~QCOW2_AUTOCLEAR_MASK;

would have worked just as well and might have been a bit easier to read.

Anyway:

Reviewed-by: Max Reitz <address@hidden>

> +
> +    if (need_update_header && !bs->read_only && !(flags & BDRV_O_INACTIVE)) {
> +        s->autoclear_features &= QCOW2_AUTOCLEAR_MASK;
>          ret = qcow2_update_header(bs);
>          if (ret < 0) {
>              error_setg_errno(errp, -ret, "Could not update qcow2 header");

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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