Skip to content

Fix KVM import/unmanage support for SharedMountPoint pools#12956

Open
prashanthr2 wants to merge 1 commit intoapache:4.22from
prashanthr2:fix-importvolume-sharedmountpoint
Open

Fix KVM import/unmanage support for SharedMountPoint pools#12956
prashanthr2 wants to merge 1 commit intoapache:4.22from
prashanthr2:fix-importvolume-sharedmountpoint

Conversation

@prashanthr2
Copy link
Copy Markdown

Summary

  • allow SharedMountPoint in KVM supported pool types for import/unmanage validation
  • allow SharedMountPoint in KVM qemu-img supported pool types used by volume listing for import

Issue

Fixes #12954

Testing

  • not run (targeted code-path change only)

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.60%. Comparing base (4708121) to head (8c641a3).

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           
Flag Coverage Δ
uitests 3.70% <ø> (ø)
unittests 18.68% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

@DaanHoogland DaanHoogland added this to the 4.22.1 milestone Apr 8, 2026
@DaanHoogland DaanHoogland requested review from Copilot and weizhouapache and removed request for Copilot April 8, 2026 09:52
@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.SharedMountPoint to the KVM qemu-img supported pool types used for volume listing during import.
  • Add StoragePoolType.SharedMountPoint to 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.

Comment on lines 54 to +55
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);
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines 39 to +40
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);
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

not tested yet

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17397

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.

ImportVolumeCmd fails for SharedMountPoint primary storage with "not supported" error on KVM

5 participants