[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 10/42] block: Use CAF in bdrv_is_encrypted()
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH v5 10/42] block: Use CAF in bdrv_is_encrypted() |
Date: |
Thu, 13 Jun 2019 16:15:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 13.06.19 15:16, Vladimir Sementsov-Ogievskiy wrote:
> 13.06.2019 1:09, Max Reitz wrote:
>> bdrv_is_encrypted() should not only check the BDS's backing child, but
>> any filtered child: If a filter's child is encrypted, the filter node
>> itself naturally is encrypted, too. Furthermore, we need to recurse
>> down the chain.
>>
>> (CAF means child access function.)
>
> Hmm, so, if only one node in the backing chain is encrypted, all overlays,
> filters or not are considered encrypted too? Even if all the data is in top
> node and is not encrypted?
>
> Checked that the function is used only for reporting through
> bdrv_query_image_info, which is called from bdrv_block_device_info() (which
> loops through backings), and from collect_image_info_list(), which loops
> through
> backings if @chain=true.
>
> And collect_image_info_list() is used only in img_info(), @chain is a mirrored
> --backing-chain parameter..
>
> So, isn't it more correct to return exactly bs->encrypted in this function?
> It will
> give more correct and informative results for queries for the whole chain.
Hm. Maybe? :-)
I personally feel more comfortable to report more devices as being
reported than less. The description of @encrypted in @BlockDeviceInfo
is vague enough that we can just “make it more precise”.
You’re right, it does sound more useful.
Max
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 04/42] block: Add child access functions, (continued)
- [Qemu-devel] [PATCH v5 06/42] qcow2: Implement .bdrv_storage_child(), Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 10/42] block: Use CAF in bdrv_is_encrypted(), Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 08/42] block: bdrv_set_backing_hd() is about bs->backing, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 09/42] block: Include filters when freezing backing chain, Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 07/42] block: *filtered_cow_child() for *has_zero_init(), Max Reitz, 2019/06/12
- [Qemu-devel] [PATCH v5 11/42] block: Add bdrv_supports_compressed_writes(), Max Reitz, 2019/06/12