Skip to content

KVM: fix host.volume.encryption always false with qemu-img >= 10.1 (help header changed) [4.22]#13587

Open
nikolauseppinger wants to merge 1 commit into
apache:4.22from
nikolauseppinger:fix/kvm-qemuimg-luks-detection-qemu10.1-4.22
Open

KVM: fix host.volume.encryption always false with qemu-img >= 10.1 (help header changed) [4.22]#13587
nikolauseppinger wants to merge 1 commit into
apache:4.22from
nikolauseppinger:fix/kvm-qemuimg-luks-detection-qemu10.1-4.22

Conversation

@nikolauseppinger

Copy link
Copy Markdown

Description

Backport of #13583 to the 4.22 branch.

Fixes KVM volume encryption detection on hosts with qemu-img >= 10.1.0.

QEMU changed the qemu-img --help supported-formats header from
"Supported formats:" to "Supported image formats:" in 10.1.0. The detection
regex in QemuImg.helpSupportsImageFormat() no longer matched, so
hostSupportsVolumeEncryption() returned false and host.volume.encryption
was stored as false, blocking encrypted offerings on affected hosts (e.g.
RHEL 9.8 shipping qemu-img 10.1.0).

The regex now treats the "image" keyword as optional and is covered by unit
tests for both the legacy and the new header, plus a negative case.

Cherry-picked cleanly from main (commit cd1c427) onto 4.22, no conflicts.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Bug Severity

  • Major

qemu-img 10.1.0 changed the "qemu-img --help" supported-formats header
from "Supported formats:" to "Supported image formats:". The regex in
QemuImg.helpSupportsImageFormat() only matched the old header, so
hostSupportsVolumeEncryption() returned false on affected hosts even
though cryptsetup and the luks format were both available, blocking
encrypted offerings.

Make the "image" keyword optional in the regex so it matches both the
legacy and current qemu-img help output.
@weizhouapache

Copy link
Copy Markdown
Member

thanks @nikolauseppinger

I have closed #13583

@weizhouapache

Copy link
Copy Markdown
Member

@blueorangutan package

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 17.67%. Comparing base (5767127) to head (055f96f).
⚠️ Report is 17 commits behind head on 4.22.

Files with missing lines Patch % Lines
...java/org/apache/cloudstack/utils/qemu/QemuImg.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               4.22   #13587    +/-   ##
==========================================
  Coverage     17.67%   17.67%            
+ Complexity    15797    15794     -3     
==========================================
  Files          5923     5925     +2     
  Lines        533372   533483   +111     
  Branches      65256    65256            
==========================================
+ Hits          94253    94273    +20     
- Misses       428460   428553    +93     
+ Partials      10659    10657     -2     
Flag Coverage Δ
uitests 3.69% <ø> (-0.01%) ⬇️
unittests 18.74% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants