aboutsummaryrefslogtreecommitdiff
path: root/docs/qcow2-cache.txt
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2020-07-10 18:12:49 +0200
committerMax Reitz <mreitz@redhat.com>2020-08-25 08:33:20 +0200
commit30afc12085c8e7759abc77651f65916afdca7bbd (patch)
tree455fa79548bb6ad61bce2ec7dbdfd0e45a934e4f /docs/qcow2-cache.txt
parent12c6aebedfb6b90d5f019ab536dd3f2752e6e361 (diff)
downloadqemu-30afc12085c8e7759abc77651f65916afdca7bbd.zip
qemu-30afc12085c8e7759abc77651f65916afdca7bbd.tar.gz
qemu-30afc12085c8e7759abc77651f65916afdca7bbd.tar.bz2
qcow2: Document the Extended L2 Entries feature
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 <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <5199f2e1c717bcaa58b48142c9062b803145ff7f.1594396418.git.berto@igalia.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'docs/qcow2-cache.txt')
-rw-r--r--docs/qcow2-cache.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt
index d57f409..5f763aa 100644
--- a/docs/qcow2-cache.txt
+++ b/docs/qcow2-cache.txt
@@ -1,6 +1,6 @@
qcow2 L2/refcount cache configuration
=====================================
-Copyright (C) 2015, 2018 Igalia, S.L.
+Copyright (C) 2015, 2018-2020 Igalia, S.L.
Author: Alberto Garcia <berto@igalia.com>
This work is licensed under the terms of the GNU GPL, version 2 or
@@ -222,3 +222,20 @@ support this functionality, and is 0 (disabled) on other platforms.
This functionality currently relies on the MADV_DONTNEED argument for
madvise() to actually free the memory. This is a Linux-specific feature,
so cache-clean-interval is not supported on other systems.
+
+
+Extended L2 Entries
+-------------------
+All numbers shown in this document are valid for qcow2 images with normal
+64-bit L2 entries.
+
+Images with extended L2 entries need twice as much L2 metadata, so the L2
+cache size must be twice as large for the same disk space.
+
+ disk_size = l2_cache_size * cluster_size / 16
+
+i.e.
+
+ l2_cache_size = disk_size * 16 / cluster_size
+
+Refcount blocks are not affected by this.