Fix KVM import/unmanage support for SharedMountPoint pools#12956
Fix KVM import/unmanage support for SharedMountPoint pools#12956prashanthr2 wants to merge 1 commit intoapache:4.22from
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12956 +/- ##
=========================================
Coverage 17.60% 17.60%
+ Complexity 15677 15676 -1
=========================================
Files 5918 5918
Lines 531681 531681
Branches 65005 65005
=========================================
Hits 93623 93623
Misses 427498 427498
Partials 10560 10560
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:
|
|
@blueorangutan package |
|
@DaanHoogland 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. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates KVM volume import/unmanage and volume listing validation to recognize SharedMountPoint storage pools as supported, addressing missing support for that pool type (Fixes #12954).
Changes:
- Add
StoragePoolType.SharedMountPointto the KVMqemu-imgsupported pool types used for volume listing during import. - Add
StoragePoolType.SharedMountPointto the KVM supported pool types used for import/unmanage validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVolumesOnStorageCommandWrapper.java | Extends the qemu-img supported pool type list to include SharedMountPoint. |
| api/src/main/java/org/apache/cloudstack/storage/volume/VolumeImportUnmanageService.java | Extends KVM import/unmanage validation to allow SharedMountPoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static final List<StoragePoolType> STORAGE_POOL_TYPES_SUPPORTED_BY_QEMU_IMG = Arrays.asList(StoragePoolType.NetworkFilesystem, | ||
| StoragePoolType.Filesystem, StoragePoolType.RBD); | ||
| StoragePoolType.Filesystem, StoragePoolType.RBD, StoragePoolType.SharedMountPoint); |
There was a problem hiding this comment.
Arrays.asList(...) returns a fixed-size but still mutable list (elements can be replaced via set(...)). Since this is a shared static final constant, consider making it truly immutable (e.g., List.of(...) if available in your Java baseline, or wrap with Collections.unmodifiableList(...)) to prevent accidental runtime mutation.
| List<Storage.StoragePoolType> SUPPORTED_STORAGE_POOL_TYPES_FOR_KVM = Arrays.asList(Storage.StoragePoolType.NetworkFilesystem, | ||
| Storage.StoragePoolType.Filesystem, Storage.StoragePoolType.RBD); | ||
| Storage.StoragePoolType.Filesystem, Storage.StoragePoolType.RBD, Storage.StoragePoolType.SharedMountPoint); |
There was a problem hiding this comment.
Same immutability concern here: Arrays.asList(...) produces a list that can still be mutated via set(...). Since this is an interface constant used for validation, it’s safer to expose an immutable list (e.g., List.of(...) or Collections.unmodifiableList(Arrays.asList(...))) to avoid unexpected behavior if any caller modifies it.
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
not tested yet
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17397 |
Summary
Issue
Fixes #12954
Testing