Skip to content

block: qcow: Add read support for zero bit in L2 entries#7627

Merged
likebreath merged 2 commits intocloud-hypervisor:mainfrom
weltling:qcow2-l2-zero-flag
Jan 22, 2026
Merged

block: qcow: Add read support for zero bit in L2 entries#7627
likebreath merged 2 commits intocloud-hypervisor:mainfrom
weltling:qcow2-l2-zero-flag

Conversation

@weltling
Copy link
Copy Markdown
Member

Implements support for bit 0 in QCOW2 v3 L2 table entries. When set, the cluster reads as zeros without disk access, improving compatibility with QCOW2 images using this optimization.

@weltling weltling requested a review from a team as a code owner January 22, 2026 12:30
Implement read support for bit 0 in QCOW2 L2 table entries.
When this flag is set, the cluster reads as zeros without accessing
disk. This improves compatibility with QCOW2 images that use this
optimization.

According to the QCOW2 specification, bit 0 of the standard cluster
descriptor indicates that the cluster reads as zeros. Unlike
l2_entry == 0 indicating a completely unallocated entry, bit 0 can
be set on an allocated cluster.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
Add test for l2_entry_is_zero() and related helper functions.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
@likebreath likebreath added this pull request to the merge queue Jan 22, 2026
Merged via the queue into cloud-hypervisor:main with commit eaafe42 Jan 22, 2026
42 of 43 checks passed
@weltling weltling deleted the qcow2-l2-zero-flag branch January 23, 2026 08:15
liuw added a commit to liuw/cloud-hypervisor that referenced this pull request Feb 10, 2026
Since kernel commit 6693731487a8 ("vsock/virtio: Allocate nonlinear SKBs
for handling large transmit buffers"), a large vsock packet can be split
into multiple descriptors.

If we encounter such TX packets, pull the content into an owned buffer.

Fixes: cloud-hypervisor#7627
Signed-off-by: Wei Liu <liuwe@microsoft.com>
liuw added a commit to liuw/cloud-hypervisor that referenced this pull request Feb 10, 2026
Since kernel commit 6693731487a8 ("vsock/virtio: Allocate nonlinear SKBs
for handling large transmit buffers"), a large vsock packet can be split
into multiple descriptors.

If we encounter such TX packets, pull the content into an owned buffer.

Fixes: cloud-hypervisor#7627
Signed-off-by: Wei Liu <liuwe@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants