Fix domain parsing for GPU & add Display controller in the supported PCI class#12981
Fix domain parsing for GPU & add Display controller in the supported PCI class#12981vishesh92 wants to merge 6 commits intoapache:4.22from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses CloudStack issue #12960 where GPU passthrough VM creation can fail on KVM due to incorrect parsing of PCI addresses (notably when the domain portion is present/expanded), leading to invalid libvirt PCI slot values.
Changes:
- Update KVM GPU discovery script to consistently normalize/handle PCI addresses with and without an explicit domain and to key lookups using the domain-qualified form.
- Update
LibvirtGpuDefPCI XML generation to accept bothbb:ss.fanddddd:bb:ss.fbus address formats. - Add unit tests covering full PCI addresses (domain 0, non-zero domain) and legacy short BDF behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/vm/hypervisor/kvm/gpudiscovery.sh | Normalizes PCI address handling (domain-aware) across sysfs access, cache keys, and VM usage mapping to avoid wrong BDF parsing. |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtGpuDef.java | Extends PCI address parsing to support domain:bus:slot.func input, preventing slot mis-parsing when a domain is present. |
| plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtGpuDefTest.java | Adds regression/unit tests for full PCI addresses and backward compatibility for short BDF inputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtGpuDef.java
Outdated
Show resolved
Hide resolved
plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtGpuDefTest.java
Outdated
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12981 +/- ##
=========================================
Coverage 17.60% 17.60%
- Complexity 15673 15680 +7
=========================================
Files 5918 5918
Lines 531681 531739 +58
Branches 65005 65016 +11
=========================================
+ Hits 93589 93636 +47
- Misses 427539 427545 +6
- Partials 10553 10558 +5
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:
|
this adds support for the amd instinct mi2xx accelorator crards in the discovery script.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtGpuDef.java
Show resolved
Hide resolved
|
@blueorangutan package |
|
@vishesh92 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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17398 |
|
@blueorangutan package |
|
@vishesh92 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
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtGpuDef.java
Show resolved
Hide resolved
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17399 |
|
@blueorangutan test |
|
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Description
This PR fixes #12960 & #12957
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?