Skip to content

Conversation

@Pearl1594
Copy link
Contributor

Description

This PR fixes: #12225

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.21%. Comparing base (4348386) to head (3dac829).

Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #12232   +/-   ##
=========================================
  Coverage     16.21%   16.21%           
- Complexity    13353    13355    +2     
=========================================
  Files          5657     5657           
  Lines        498647   498648    +1     
  Branches      60533    60533           
=========================================
+ Hits          80863    80875   +12     
+ Misses       408771   408755   -16     
- Partials       9013     9018    +5     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.07% <100.00%> (+<0.01%) ⬆️

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.

Copy link
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

This PR fixes a NullPointerException that occurs when removing a NIC from a stopped VM that uses a service offering with CPU cap set. The fix gracefully handles the scenario where the host is not available instead of throwing an exception.

Key Changes:

  • Modified error handling in setVmQuotaPercentage to log a warning and skip CPU quota calculation when host is unavailable
  • Updated corresponding test to verify the new graceful degradation behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
server/src/main/java/com/cloud/hypervisor/KVMGuru.java Changed from throwing CloudRuntimeException to logging warning and returning early when host is null, preventing NPE
server/src/test/java/com/cloud/hypervisor/KVMGuruTest.java Updated test to verify that CPU quota is not set when host is unavailable, rather than expecting an exception

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
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

@sonarqubecloud
Copy link

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants