qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v2 1/2] block: Disallow snapshots if the overlay


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v2 1/2] block: Disallow snapshots if the overlay doesn't support backing files
Date: Mon, 2 Nov 2015 17:53:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 02.11.2015 13:15, Alberto Garcia wrote:
> This addresses scenarios like this one:
> 
>   { 'execute': 'blockdev-add', 'arguments':
>     { 'options': { 'driver': 'qcow2',
>                    'node-name': 'new0',
>                    'file': { 'driver': 'file',
>                              'filename': 'new.qcow2',
>                              'node-name': 'file0' } } } }
> 
>   { 'execute': 'blockdev-snapshot', 'arguments':
>     { 'node': 'virtio0',
>       'overlay': 'file0' } }
> 
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
>  blockdev.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/blockdev.c b/blockdev.c
> index a567a05..2774bf5 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1667,6 +1667,11 @@ static void 
> external_snapshot_prepare(BlkTransactionState *common,
>  
>      if (state->new_bs->backing != NULL) {
>          error_setg(errp, "The snapshot already has a backing image");
> +        return;

This is...

> +    }
> +
> +    if (!state->new_bs->drv->supports_backing) {
> +        error_setg(errp, "The snapshot does not support backing images");

...why a return statement might be good here, too.

With or without:

Reviewed-by: Max Reitz <address@hidden>

>      }
>  }
>  
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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