Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14224 +/- ##
============================================
+ Coverage 19.91% 20.21% +0.29%
- Complexity 20200 20749 +549
============================================
Files 6373 6426 +53
Lines 577230 580177 +2947
Branches 70696 71028 +332
============================================
+ Hits 114974 117294 +2320
- Misses 449690 450170 +480
- Partials 12566 12713 +147
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 7
Open (10)
maskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be… · NewmaskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be… · NewmaskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be… · NewmaskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be… · New These exception logs only includee.getMessage()and drop the stack trace, which makes… · New These exception logs only includee.getMessage()and drop the stack trace, which makes… · New These exception logs only includee.getMessage()and drop the stack trace, which makes… · New There are a couple of formatting issues that reduce readability/consistency in logs: (1) line 161… · NewString.valueOf(migrateDowntime)is unnecessary for parameterized logging (it will be converted… · New There are a couple of formatting issues that reduce readability/consistency in logs: (1) line 161… · New
What changed in this PR
Refactors KVM VM migration logging to be more consistent and contextual, primarily by switching to parameterized logging and standardizing messages for troubleshooting.
Changes:
- Replaced
String.format/string concatenation with parameterized logging across KVM migration flow. - Expanded log context (destination host, XML retrieval flag, job stats) for better traceability.
- Tweaked log levels/messages around migration timeouts and exception handling.
| File | Description |
|---|---|
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java | Standardizes and enriches migration logs; adjusts log levels and message structure. |
| engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java | Fixes/standardizes config-drive detach logging and improves message quality. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
thanks @erikbocks, log changes look right. LGTM |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open findings
This error log lacks key troubleshooting context available in-scope (at least the VM instance name… · New This logs bothe.getMessage()and the exceptione. Since the throwable is already passed,… · New The same error logging line is duplicated across two catch blocks. To reduce drift and keep logging… · New The same error logging line is duplicated across two catch blocks. To reduce drift and keep logging… · New
10 resolved since last review
These exception logs only includee.getMessage()and drop the stack trace, which makes… These exception logs only includee.getMessage()and drop the stack trace, which makes… These exception logs only includee.getMessage()and drop the stack trace, which makes…maskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be…maskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be…maskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be…maskSensitiveInfoInXML(xmlDesc)is evaluated eagerly even when DEBUG is disabled, which can be… There are a couple of formatting issues that reduce readability/consistency in logs: (1) line 161…String.valueOf(migrateDowntime)is unnecessary for parameterized logging (it will be converted… There are a couple of formatting issues that reduce readability/consistency in logs: (1) line 161…
🧠 Review effort: Lite
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open findings
4 resolved since last review
This logs bothe.getMessage()and the exceptione. Since the throwable is already passed,… This error log lacks key troubleshooting context available in-scope (at least the VM instance name… The same error logging line is duplicated across two catch blocks. To reduce drift and keep logging… The same error logging line is duplicated across two catch blocks. To reduce drift and keep logging…
🧠 Review effort: Lite
| logger.error("TIme out occurred while exeuting command AttachOrDettachConfigDrive {}", e.getMessage(), e); | ||
|
|
||
| } | ||
| logger.error("Timeout occurred while executing command AttachOrDettachConfigDrive for VM {} on source host {}", vm.getInstanceName(), srcHost.getId(), e); } |
| logger.info("VM domain state when trying to pause VM for migration: {}.", state); | ||
| } catch (final LibvirtException e) { | ||
| logger.info("Couldn't get VM domain state after " + sleeptime + "ms: " + e.getMessage()); | ||
| logger.info("Could not get VM domain state after {}ms: {}.", sleeptime, e.getMessage()); |
| } | ||
|
|
||
| private void logMigrationFailure(String vmName, String destinationIp, Exception exception) { | ||
| logger.error("Could not migrate domain [{}] to host [{}].", vmName, destinationIp, exception); |


Description
This PR focuses on improving the consistency and clarity of logging of the KVM VM migration process. The changes aim to improve the traceability of the process, by adding more context for the logs, helping future troubleshooting processes. It also standardizes log messages to use parametrized logging, instead of string concatenation.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
The code was compiled with Maven and installed to my local environment. Then, I migrated a VM from one of my hosts to another and verified that the new logs were displayed correctly.