Skip to content

Fix discard alignment issue in VM due to QCOW2 bitmap layer - #3922

Merged
stgraber merged 2 commits into
lxc:mainfrom
stgraber:more-fixes
Aug 29, 2026
Merged

stgraber merged 2 commits into
lxc:mainfrom
stgraber:more-fixes

Conversation

@stgraber

Copy link
Copy Markdown
Member

Our use of a QCOW2 layer for bitmap tracking causes QEMU to use 64k aligned chunks for discard. We weren't communicating that to the guest leading to misaligned requests that QEMU would then just drop.

In the worst case this was causing IncusOS to fallback to a full zeroing of the entire 50GiB+ drive rather than a single discard request.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
…rity

qcow2 drops discards that don't cover a whole cluster, so the guest must
be told the cluster size to align its requests.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@stgraber
stgraber requested review from bensmrs and presztak August 29, 2026 00:24
@stgraber
stgraber merged commit d6b4984 into lxc:main Aug 29, 2026
174 of 175 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants