|
From: | Eric Blake |
Subject: | Re: [RFC PATCH v3 05/27] qcow2: Document the Extended L2 Entries feature |
Date: | Thu, 20 Feb 2020 08:33:57 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 12/22/19 5:36 AM, Alberto Garcia wrote:
Subcluster allocation in qcow2 is implemented by extending the existing L2 table entries and adding additional information to indicate the allocation status of each subcluster. This patch documents the changes to the qcow2 format and how they affect the calculation of the L2 cache size. Signed-off-by: Alberto Garcia <address@hidden> ---
@@ -437,7 +445,7 @@ cannot be relaxed without an incompatible layout change). Given an offset into the virtual disk, the offset into the image file can be obtained as follows:- l2_entries = (cluster_size / sizeof(uint64_t))+ l2_entries = (cluster_size / sizeof(uint64_t)) [*]l2_index = (offset / cluster_size) % l2_entriesl1_index = (offset / cluster_size) / l2_entries @@ -447,6 +455,8 @@ obtained as follows:return cluster_offset + (offset % cluster_size) + [*] this changes if Extended L2 Entries are enabled, see next section
+The size of an extended L2 entry is 128 bits so the number of entries per table +is calculated using this formula: + + l2_entries = (cluster_size / (2 * sizeof(uint64_t)))
Is it worth unifying these statements by writing: l2_entries = (cluster_size / ((1 + extended_l2) * sizeof(uint64_t))) or is that too confusing? -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |