-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Reviewed-by: Max Reitz <[email protected]> Reviewed-by: Eric Blake <[email protected]> Message-Id: <5199f2e1c717bcaa58b48142c9062b803145ff7f.1594396418.git.berto@igalia.com> Signed-off-by: Max Reitz <[email protected]>
- Loading branch information
Showing
2 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
|
||
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. |