mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
kvm: truncate vnc password to 8 chars (#6244)
This PR truncates the vnc password of kvm vms to 8 chars to support latest versions of libvirt.
This commit is contained in:
parent
4004dfcfd8
commit
aa0197c141
@ -1764,7 +1764,7 @@ public class LibvirtVMDef {
|
||||
graphicBuilder.append(" listen=''");
|
||||
}
|
||||
if (_passwd != null) {
|
||||
graphicBuilder.append(" passwd='" + _passwd + "'");
|
||||
graphicBuilder.append(" passwd='" + StringUtils.truncate(_passwd, 8) + "'");
|
||||
} else if (_keyMap != null) {
|
||||
graphicBuilder.append(" _keymap='" + _keyMap + "'");
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@ import org.apache.cloudstack.utils.linux.CPUStat;
|
||||
import org.apache.cloudstack.utils.linux.MemStat;
|
||||
import org.apache.cloudstack.utils.qemu.QemuImg.PhysicalDiskFormat;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
@ -774,7 +775,7 @@ public class LibvirtComputingResourceTest {
|
||||
assertXpath(domainDoc, prefix + "/graphics/@type", "vnc");
|
||||
assertXpath(domainDoc, prefix + "/graphics/@listen", to.getVncAddr());
|
||||
assertXpath(domainDoc, prefix + "/graphics/@autoport", "yes");
|
||||
assertXpath(domainDoc, prefix + "/graphics/@passwd", to.getVncPassword());
|
||||
assertXpath(domainDoc, prefix + "/graphics/@passwd", StringUtils.truncate(to.getVncPassword(), 8));
|
||||
}
|
||||
|
||||
private void verifySerialDevices(Document domainDoc, String prefix) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user