leolleeooleo commented on code in PR #6404:
URL: https://github.com/apache/cloudstack/pull/6404#discussion_r878891539
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java:
##########
@@ -151,6 +152,13 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0.
xmlDesc = dm.getXMLDesc(xmlFlag);
xmlDesc = replaceIpForVNCInDescFile(xmlDesc, target);
+ // Limit the VNC password in case the length is greater than 8
characters
+ // Since libvirt version 8 VNC passwords are limited to 8
characters
+ if
(org.apache.commons.lang3.StringUtils.isNotBlank(to.getVncPassword())) {
Review Comment:
I suggest getting password from `xmlDesc`
```
String oldVncPassword = getVncPassword(xmlDesc);
if (oldVncPassword != null && oldVncPassword.length() > 8) {
String newVncPassword =
org.apache.commons.lang3.StringUtils.truncate(oldVncPassword, 8);
xmlDesc = replaceVncPassword(xmlDesc, newVncPassword);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]