[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v3 11/27] qcow2: Add QCow2SubclusterType and qcow2_get_su
From: |
Max Reitz |
Subject: |
Re: [RFC PATCH v3 11/27] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type() |
Date: |
Thu, 20 Feb 2020 18:21:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 22.12.19 12:36, Alberto Garcia wrote:
> This patch adds QCow2SubclusterType, which is the subcluster-level
> version of QCow2ClusterType. All QCOW2_SUBCLUSTER_* values have the
> the same meaning as their QCOW2_CLUSTER_* equivalents (when they
> exist). See below for details and caveats.
>
> In images without extended L2 entries clusters are treated as having
> exactly one subcluster so it is possible to replace one data type with
> the other while keeping the exact same semantics.
>
> With extended L2 entries there are new possible values, and every
> subcluster in the same cluster can obviously have a different
> QCow2SubclusterType so functions need to be adapted to work on the
> subcluster level.
>
> There are several things that have to be taken into account:
>
> a) QCOW2_SUBCLUSTER_COMPRESSED means that the whole cluster is
> compressed. We do not support compression at the subcluster
> level.
>
> b) There are two different values for unallocated subclusters:
> QCOW2_SUBCLUSTER_UNALLOCATED_PLAIN which means that the whole
> cluster is unallocated, and QCOW2_SUBCLUSTER_UNALLOCATED_ALLOC
> which means that the cluster is allocated but the subcluster is
> not. The latter can only happen in images with extended L2
> entries.
>
> c) QCOW2_SUBCLUSTER_INVALID is used to detect the cases where an L2
> entry has a value that violates the specification. The caller is
> responsible for handling these situations.
>
> To prevent compatibility problems with images that have invalid
> values but are currently being read by QEMU without causing side
> effects, QCOW2_SUBCLUSTER_INVALID is only returned for images
> with extended L2 entries.
>
> qcow2_cluster_to_subcluster_type() is added as a separate function
> from qcow2_get_subcluster_type(), but this is only temporary and both
> will be merged in a subsequent patch.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> block/qcow2.h | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 92 insertions(+)
With the comment style fixed as now required by the coding style (/* and
*/ on separate lines), and regardless of the bit ordering:
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [RFC PATCH v3 11/27] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type(),
Max Reitz <=