qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH 1/5] block: Add BDS.never_freeze


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH 1/5] block: Add BDS.never_freeze
Date: Tue, 2 Jul 2019 17:28:37 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0

On 02.07.19 16:02, Alberto Garcia wrote:
> On Fri 28 Jun 2019 12:32:51 AM CEST, Max Reitz wrote:
>> @@ -4416,6 +4416,14 @@ int bdrv_freeze_backing_chain(BlockDriverState *bs, 
>> BlockDriverState *base,
>>          return -EPERM;
>>      }
>>  
>> +    for (i = bs; i != base; i = backing_bs(i)) {
>> +        if (i->backing && backing_bs(i)->never_freeze) {
>> +            error_setg(errp, "Cannot freeze '%s' link to '%s'",
>> +                       i->backing->name, backing_bs(i)->node_name);
>> +            return -EPERM;
>> +        }
>> +    }
> 
> How about adding this to bdrv_is_backing_chain_frozen() instead?

But that’s the wrong place.  For example, that function is called by
bdrv_set_backing_hd() to check whether the backing BDS can be changed.
But the point of never_freeze is to ensure that links to the BDS can be
changed.

never_freeze only becomes relevant when trying to freeze the backing
chain, in that it should prevent it.  So I think putting the check here
is correct.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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