qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-block] [PATCH v2] blockdev: unset inappropriate f


From: Max Reitz
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v2] blockdev: unset inappropriate flags when changing medium
Date: Sat, 6 Feb 2016 15:39:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 06.02.2016 14:36, Alyssa Milburn wrote:
> Most importantly, this removes BDRV_O_TEMPORARY, to avoid unlink()ing an
> image which replaces a snapshotted one.
> 
> Signed-off-by: Alyssa Milburn <address@hidden>
> ---
>  blockdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/blockdev.c b/blockdev.c
> index be4ca44..a916b06 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -2514,6 +2514,8 @@ void qmp_blockdev_change_medium(const char *device, 
> const char *filename,
>      }
>  
>      bdrv_flags = blk_get_open_flags_from_root_state(blk);
> +    bdrv_flags &= ~(BDRV_O_TEMPORARY | BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING |
> +        BDRV_O_PROTOCOL);
>  
>      if (!has_read_only) {
>          read_only = BLOCKDEV_CHANGE_READ_ONLY_MODE_RETAIN;
> 

Thanks, applied to my block tree:

https://github.com/XanClic/qemu/commits/block

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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