qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subclu


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v4 13/30] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()
Date: Tue, 14 Apr 2020 14:10:47 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

17.03.2020 21:16, 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>


Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>

--
Best regards,
Vladimir



reply via email to

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