KVM: fix host.volume.encryption always false with qemu-img >= 10.1 (help header changed)#13583
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13583 +/- ##
=========================================
Coverage 19.47% 19.47%
+ Complexity 19352 19351 -1
=========================================
Files 6294 6294
Lines 568164 568164
Branches 69600 69600
=========================================
+ Hits 110664 110675 +11
+ Misses 445422 445410 -12
- Partials 12078 12079 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
verified the command, it worked with both and |
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18528 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
@nikolauseppinger |
|
moving to 4.22.2 milestone |
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.
cd1c427 to
5d0f0fa
Compare
|
[SF] Trillian test result (tid-16523)
|
Description
Fixes KVM volume encryption detection on hosts with qemu-img >= 10.1.0.
QEMU changed the
qemu-img --helpsupported-formats header from"Supported formats:" to "Supported image formats:" in 10.1.0. The detection
regex in
QemuImg.helpSupportsImageFormat()no longer matched, sohostSupportsVolumeEncryption()returned false andhost.volume.encryptionwas 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.
Verified locally: full reactor build of
plugins/hypervisors/kvm(checkstyle,compile, testCompile, surefire) via Maven 3.8 / JDK 11 in Docker succeeds, and
a standalone JUnit run exercising
helpSupportsImageFormat()directly againstboth the legacy
Supported formats:header and the new qemu-img 10.1.0Supported image formats:header passes (3/3), confirming the fix isbackward compatible.
Types of changes
Bug Severity