Validate qcow2 file during import operation#11264
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #11264 +/- ##
============================================
- Coverage 15.18% 15.17% -0.01%
+ Complexity 11367 11363 -4
============================================
Files 5415 5415
Lines 475910 476025 +115
Branches 58099 58114 +15
============================================
- Hits 72254 72246 -8
- Misses 395569 395696 +127
+ Partials 8087 8083 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds qcow2 file validation during import operations to enhance security and data integrity. The changes consolidate duplicate code for getting virtual size from disk files and introduce a new validation method for qcow2 files.
- Consolidates duplicate
getVirtualSizeFromFilemethod implementations into a single utility method - Adds qcow2 file validation using
Qcow2Inspector.validateQcow2File - Integrates qcow2 validation into copy and check volume operations
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| KVMPhysicalDisk.java | Adds centralized utility methods for getting virtual size and validating qcow2 files |
| LibvirtResizeVolumeCommandWrapper.java | Removes duplicate getVirtualSizeFromFile method and uses centralized version |
| LibvirtCopyRemoteVolumeCommandWrapper.java | Removes duplicate method, adds qcow2 validation, and uses centralized utilities |
| LibvirtCheckVolumeCommandWrapper.java | Removes duplicate method, adds qcow2 validation, and uses centralized utilities |
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMPhysicalDisk.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14302 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm, good cleanup
kiranchavala
left a comment
There was a problem hiding this comment.
|
[SF] Trillian test result (tid-13848)
|
137f3be to
541274e
Compare
…encrypted volume, and volume with backing file
541274e to
210a3f2
Compare
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
@kiranchavala updated, please check with latest packages |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14342 |




Description
This PR validates qcow2 file during import operation (and has some code improvements).
Fixes #11260
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?